summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/V8IsolatedWorld.h
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-12-15 10:12:09 +0000
committerSteve Block <steveblock@google.com>2009-12-17 17:41:10 +0000
commit643ca7872b450ea4efacab6188849e5aac2ba161 (patch)
tree6982576c228bcd1a7efe98afed544d840751094c /WebCore/bindings/v8/V8IsolatedWorld.h
parentd026980fde6eb3b01c1fe49441174e89cd1be298 (diff)
downloadexternal_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.zip
external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.gz
external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.bz2
Merge webkit.org at r51976 : Initial merge by git.
Change-Id: Ib0e7e2f0fb4bee5a186610272edf3186f0986b43
Diffstat (limited to 'WebCore/bindings/v8/V8IsolatedWorld.h')
-rw-r--r--WebCore/bindings/v8/V8IsolatedWorld.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/WebCore/bindings/v8/V8IsolatedWorld.h b/WebCore/bindings/v8/V8IsolatedWorld.h
index 663f4bd..6313da8 100644
--- a/WebCore/bindings/v8/V8IsolatedWorld.h
+++ b/WebCore/bindings/v8/V8IsolatedWorld.h
@@ -61,6 +61,7 @@ namespace WebCore {
// Creates an isolated world. To destroy it, call destroy().
// This will delete the isolated world when the context it owns is GC'd.
V8IsolatedWorld(V8Proxy* proxy, int extensionGroup);
+ ~V8IsolatedWorld();
// Call this to destroy the isolated world. It will be deleted sometime
// after this call, once all script references to the world's context
@@ -84,7 +85,9 @@ namespace WebCore {
// 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(); }
@@ -93,9 +96,10 @@ namespace WebCore {
DOMDataStore* getDOMDataStore() const { return m_domDataStore.getStore(); }
private:
- ~V8IsolatedWorld();
-
- 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.