ASSERTION FAILURE: !m_adoptionIsRequired for the WebFrame under the
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Oct 2010 15:29:14 +0000 (15:29 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Oct 2010 15:29:14 +0000 (15:29 +0000)
InjectedBundlePageLoaderClient::didClearWindowObjectForFrame callback.
https://bugs.webkit.org/show_bug.cgi?id=47960

Reviewed by Geoffrey Garen.

Do not try to initialize the coreFrame (which results in the
InjectedBundlePageLoaderClient::didClearWindowObjectForFrame being called) until after the
WebFrame constructor has returned and the WebFrame has been adopted.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::create):
Moved the call to init the coreFrame here ...
(WebKit::WebFrame::WebFrame):
... from here.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70148 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit2/ChangeLog
WebKit2/WebProcess/WebPage/WebFrame.cpp

index 380568f..f8fbc17 100644 (file)
@@ -1,3 +1,21 @@
+2010-10-19  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        ASSERTION FAILURE: !m_adoptionIsRequired for the WebFrame under the
+        InjectedBundlePageLoaderClient::didClearWindowObjectForFrame callback.
+        https://bugs.webkit.org/show_bug.cgi?id=47960
+
+        Do not try to initialize the coreFrame (which results in the
+        InjectedBundlePageLoaderClient::didClearWindowObjectForFrame being called) until after the
+        WebFrame constructor has returned and the WebFrame has been adopted.
+
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::create):
+        Moved the call to init the coreFrame here ...
+        (WebKit::WebFrame::WebFrame):
+        ... from here.
+
 2010-10-20  Dirk Schulze  <krit@webkit.org>
 
         Reviewed by Nikolas Zimmermann.
index 3a2ad31..15e45d0 100644 (file)
@@ -85,10 +85,12 @@ PassRefPtr<WebFrame> WebFrame::createSubframe(WebPage* page, const String& frame
 PassRefPtr<WebFrame> WebFrame::create(WebPage* page, const String& frameName, HTMLFrameOwnerElement* ownerElement)
 {
     RefPtr<WebFrame> frame = adoptRef(new WebFrame(page, frameName, ownerElement));
-    
+
     // Add explict ref() that will be balanced in WebFrameLoaderClient::frameLoaderDestroyed().
     frame->ref();
-    
+
+    frame->coreFrame()->init();
+
     return frame.release();
 }
 
@@ -112,8 +114,6 @@ WebFrame::WebFrame(WebPage* page, const String& frameName, HTMLFrameOwnerElement
         ownerElement->document()->frame()->tree()->appendChild(frame);
     }
 
-    frame->init();
-
 #ifndef NDEBUG
     webFrameCounter.increment();
 #endif