Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Unified Diff: bindings/v8/V8IsolatedWorld.h

Issue 355047: Faster access to isolated worlds. (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/WebCore/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bindings/v8/V8HiddenPropertyName.h ('k') | bindings/v8/V8IsolatedWorld.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bindings/v8/V8IsolatedWorld.h
===================================================================
--- bindings/v8/V8IsolatedWorld.h (revision 51310)
+++ bindings/v8/V8IsolatedWorld.h (working copy)
@@ -85,7 +85,9 @@
// worlds at all.
if (!isolatedWorldCount)
return 0;
- return getEnteredImpl();
+ if (!v8::Context::InContext())
+ return 0;
+ return reinterpret_cast<V8IsolatedWorld*>(getGlobalObject(v8::Context::GetEntered())->GetPointerFromInternalField(V8Custom::kDOMWindowEnteredIsolatedWorldIndex));
}
v8::Handle<v8::Context> context() { return m_context->get(); }
@@ -94,7 +96,10 @@
DOMDataStore* getDOMDataStore() const { return m_domDataStore.getStore(); }
private:
- static V8IsolatedWorld* getEnteredImpl();
+ static v8::Handle<v8::Object> getGlobalObject(v8::Handle<v8::Context> context)
+ {
+ return v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
+ }
// Called by the garbage collector when our JavaScript context is about
// to be destroyed.
« no previous file with comments | « bindings/v8/V8HiddenPropertyName.h ('k') | bindings/v8/V8IsolatedWorld.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698