summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit
diff options
context:
space:
mode:
authorharaken@chromium.org <haraken@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2014-05-22 01:02:54 +0000
committerharaken@chromium.org <haraken@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2014-05-22 01:02:54 +0000
commitcd86d76c09d7763bbbde35a3e5252149bf78e261 (patch)
tree71871eeb8ad5e704db7a02066b3637d5bd5dce0f /third_party/WebKit
parentb5d1bc8f8d9df1017aaef8bd12745401a9225d0e (diff)
downloadchromium_src-cd86d76c09d7763bbbde35a3e5252149bf78e261.zip
chromium_src-cd86d76c09d7763bbbde35a3e5252149bf78e261.tar.gz
chromium_src-cd86d76c09d7763bbbde35a3e5252149bf78e261.tar.bz2
Remove GetCurrentContext from V8Window::toV8
The code removed in this CL is now just for performance optimization (Previously it might have been not, but now it is just for performance optimization). Now that I refactored toV8Context(), we can always get a correct context by calling toV8Context(). Thus the removed code is not needed for correctness. Another interesting fact is that the removed code is not contributing to performance optimization at all. This is because: - In a case where we can get the context from the GetCurrentContext(), it means that the context is already initialized. - Then we can simply call toV8Context() to get the context, because it is guaranteed that the toV8Context() doesn't hit the heavy operation of context initialization. In conclusion, the removed code is now no help. Thus this CL removes it. BUG=357144 Review URL: https://codereview.chromium.org/293003007 git-svn-id: svn://svn.chromium.org/blink/trunk@174499 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit')
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8WindowCustom.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8WindowCustom.cpp b/third_party/WebKit/Source/bindings/v8/custom/V8WindowCustom.cpp
index fd089a8..2c25dcd 100644
--- a/third_party/WebKit/Source/bindings/v8/custom/V8WindowCustom.cpp
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8WindowCustom.cpp
@@ -533,19 +533,6 @@ v8::Handle<v8::Value> toV8(DOMWindow* window, v8::Handle<v8::Object> creationCon
if (!frame)
return v8Undefined();
- // Special case: Because of executeScriptInIsolatedWorld() one DOMWindow can have
- // multiple contexts and multiple global objects associated with it. When
- // code running in one of those contexts accesses the window object, we
- // want to return the global object associated with that context, not
- // necessarily the first global object associated with that DOMWindow.
- v8::Handle<v8::Object> currentGlobal = isolate->GetCurrentContext()->Global();
- v8::Handle<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeChain(currentGlobal, isolate);
- if (!windowWrapper.IsEmpty()) {
- if (V8Window::toNative(windowWrapper) == window)
- return currentGlobal;
- }
-
- // Otherwise, return the global object associated with this frame.
v8::Handle<v8::Context> context = toV8Context(isolate, frame, DOMWrapperWorld::current(isolate));
if (context.IsEmpty())
return v8Undefined();