Title: [122162] trunk/Source/WebKit/blackberry
Revision
122162
Author
[email protected]
Date
2012-07-09 16:05:17 -0700 (Mon, 09 Jul 2012)

Log Message

[BlackBerry] PagePopupBlackBerry::closePopup() should always clear the pointer in WebPagePrivate
https://bugs.webkit.org/show_bug.cgi?id=90817

Patch by Yong Li <[email protected]> on 2012-07-09
Reviewed by Rob Buis.

PR# 174085.
PagePopupBlackBerry::closePopup() should always clear the pointer in WebPagePrivate to avoid crashes.
This patch also removes unused variable m_parentPopup and its setter.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate): Remove m_parentPopup.
* Api/WebPage_p.h:
(WebPagePrivate):
* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::closePagePopup):
* WebCoreSupport/PagePopupBlackBerry.cpp:
(WebCore::PagePopupBlackBerry::init): Remove the setParentPopup() call.
(WebCore::PagePopupBlackBerry::closePopup): Clear the reference in WebPagePrivate.
* WebCoreSupport/SelectPopupClient.cpp:
(WebCore::SelectPopupClient::setValueAndClosePopup): Add an assert for valid m_element.

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (122161 => 122162)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-07-09 23:03:58 UTC (rev 122161)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-07-09 23:05:17 UTC (rev 122162)
@@ -404,7 +404,6 @@
     , m_updateDelegatedOverlaysDispatched(false)
     , m_deferredTasksTimer(this, &WebPagePrivate::deferredTasksTimerFired)
     , m_selectPopup(0)
-    , m_parentPopup(0)
     , m_autofillManager(AutofillManager::create(this))
 {
     static bool isInitialized = false;
@@ -6666,11 +6665,6 @@
     return d->m_selectPopup;
 }
 
-void WebPagePrivate::setParentPopup(PagePopupBlackBerry* webPopup)
-{
-    m_parentPopup = webPopup;
-}
-
 void WebPagePrivate::setInspectorOverlayClient(WebCore::InspectorOverlay::InspectorOverlayClient* inspectorOverlayClient)
 {
     if (inspectorOverlayClient) {

Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (122161 => 122162)


--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-07-09 23:03:58 UTC (rev 122161)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-07-09 23:05:17 UTC (rev 122162)
@@ -622,8 +622,6 @@
 
     // The popup that opened in this webpage
     WebCore::PagePopupBlackBerry* m_selectPopup;
-    // The popup that owned this webpage
-    WebCore::PagePopupBlackBerry* m_parentPopup;
 
     RefPtr<WebCore::AutofillManager> m_autofillManager;
 protected:

Modified: trunk/Source/WebKit/blackberry/ChangeLog (122161 => 122162)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-07-09 23:03:58 UTC (rev 122161)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-07-09 23:05:17 UTC (rev 122162)
@@ -1,3 +1,26 @@
+2012-07-09  Yong Li  <[email protected]>
+
+        [BlackBerry] PagePopupBlackBerry::closePopup() should always clear the pointer in WebPagePrivate
+        https://bugs.webkit.org/show_bug.cgi?id=90817
+
+        Reviewed by Rob Buis.
+
+        PR# 174085.
+        PagePopupBlackBerry::closePopup() should always clear the pointer in WebPagePrivate to avoid crashes.
+        This patch also removes unused variable m_parentPopup and its setter.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate): Remove m_parentPopup.
+        * Api/WebPage_p.h:
+        (WebPagePrivate):
+        * WebCoreSupport/ChromeClientBlackBerry.cpp:
+        (WebCore::ChromeClientBlackBerry::closePagePopup):
+        * WebCoreSupport/PagePopupBlackBerry.cpp:
+        (WebCore::PagePopupBlackBerry::init): Remove the setParentPopup() call.
+        (WebCore::PagePopupBlackBerry::closePopup): Clear the reference in WebPagePrivate.
+        * WebCoreSupport/SelectPopupClient.cpp:
+        (WebCore::SelectPopupClient::setValueAndClosePopup): Add an assert for valid m_element.
+
 2012-07-09  Mike Lattanzio  <[email protected]>
 
         [BlackBerry] meta viewport initial-scale doesn't factor in device pixel ratio

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp (122161 => 122162)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2012-07-09 23:03:58 UTC (rev 122161)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2012-07-09 23:05:17 UTC (rev 122162)
@@ -316,11 +316,11 @@
 
 void ChromeClientBlackBerry::closePagePopup(PagePopup*)
 {
-    if (hasOpenedPopup()) {
-        PagePopupBlackBerry* webPopup = m_webPagePrivate->m_webPage->popup();
-        webPopup->closePopup();
-        m_webPagePrivate->m_webPage->popupClosed();
-    }
+    if (!hasOpenedPopup())
+        return;
+
+    PagePopupBlackBerry* webPopup = m_webPagePrivate->m_webPage->popup();
+    webPopup->closePopup();
 }
 
 void ChromeClientBlackBerry::setToolbarsVisible(bool)

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp (122161 => 122162)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp	2012-07-09 23:03:58 UTC (rev 122161)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp	2012-07-09 23:05:17 UTC (rev 122162)
@@ -68,8 +68,6 @@
 
     installDomFunction(webpage->d->mainFrame());
 
-    webpage->d->setParentPopup(this);
-
     return true;
 }
 
@@ -162,6 +160,7 @@
 {
     m_client->didClosePopup();
     m_webPagePrivate->client()->closePopupWebView();
+    m_webPagePrivate->m_webPage->popupClosed();
 }
 
 }

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp (122161 => 122162)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp	2012-07-09 23:03:58 UTC (rev 122161)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp	2012-07-09 23:05:17 UTC (rev 122162)
@@ -144,7 +144,7 @@
 
 void SelectPopupClient::setValueAndClosePopup(int, const String& stringValue)
 {
-
+    ASSERT(m_element);
     ASSERT(m_size == stringValue.length());
 
     if (m_size > 0) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to