Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestInterfaceDocument.cpp
index 8e4e1c2..fdd7060 100644 (file)
@@ -43,6 +43,8 @@
 #include "core/dom/Document.h"
 #include "core/frame/Frame.h"
 #include "platform/TraceEvent.h"
+#include "wtf/GetPtr.h"
+#include "wtf/RefPtr.h"
 
 namespace WebCore {
 
@@ -66,7 +68,7 @@ void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceDocument
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestInterfaceDocument::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceDocument::domTemplate, V8TestInterfaceDocument::derefObject, 0, V8TestInterfaceDocument::toEventTarget, 0, V8TestInterfaceDocument::installPerContextEnabledMethods, &V8Document::wrapperTypeInfo, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestInterfaceDocument::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceDocument::domTemplate, V8TestInterfaceDocument::derefObject, 0, V8TestInterfaceDocument::toEventTarget, 0, V8TestInterfaceDocument::installPerContextEnabledMethods, &V8Document::wrapperTypeInfo, WrapperTypeObjectPrototype, false };
 
 namespace TestInterfaceDocumentV8Internal {
 
@@ -123,9 +125,10 @@ v8::Handle<v8::Object> wrap(TestInterfaceDocument* impl, v8::Handle<v8::Object>
     v8::Handle<v8::Object> wrapper = V8TestInterfaceDocument::createWrapper(impl, creationContext, isolate);
     if (wrapper.IsEmpty())
         return wrapper;
-    if (!isolatedWorldForEnteredContext(isolate)) {
+    DOMWrapperWorld* world = DOMWrapperWorld::current(isolate);
+    if (world->isMainWorld()) {
         if (Frame* frame = impl->frame())
-            frame->script().windowShell(mainThreadNormalWorld())->updateDocumentWrapper(wrapper);
+            frame->script().windowShell(world)->updateDocumentWrapper(wrapper);
     }
     return wrapper;
 }