Changeset 122162 in webkit


Ignore:
Timestamp:
Jul 9, 2012 4:05:17 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Yong Li <yoli@rim.com> 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.

Location:
trunk/Source/WebKit/blackberry
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r122135 r122162  
    405405    , m_deferredTasksTimer(this, &WebPagePrivate::deferredTasksTimerFired)
    406406    , m_selectPopup(0)
    407     , m_parentPopup(0)
    408407    , m_autofillManager(AutofillManager::create(this))
    409408{
     
    66676666}
    66686667
    6669 void WebPagePrivate::setParentPopup(PagePopupBlackBerry* webPopup)
    6670 {
    6671     m_parentPopup = webPopup;
    6672 }
    6673 
    66746668void WebPagePrivate::setInspectorOverlayClient(WebCore::InspectorOverlay::InspectorOverlayClient* inspectorOverlayClient)
    66756669{
  • trunk/Source/WebKit/blackberry/Api/WebPage_p.h

    r121872 r122162  
    623623    // The popup that opened in this webpage
    624624    WebCore::PagePopupBlackBerry* m_selectPopup;
    625     // The popup that owned this webpage
    626     WebCore::PagePopupBlackBerry* m_parentPopup;
    627625
    628626    RefPtr<WebCore::AutofillManager> m_autofillManager;
  • trunk/Source/WebKit/blackberry/ChangeLog

    r122135 r122162  
     12012-07-09  Yong Li  <yoli@rim.com>
     2
     3        [BlackBerry] PagePopupBlackBerry::closePopup() should always clear the pointer in WebPagePrivate
     4        https://bugs.webkit.org/show_bug.cgi?id=90817
     5
     6        Reviewed by Rob Buis.
     7
     8        PR# 174085.
     9        PagePopupBlackBerry::closePopup() should always clear the pointer in WebPagePrivate to avoid crashes.
     10        This patch also removes unused variable m_parentPopup and its setter.
     11
     12        * Api/WebPage.cpp:
     13        (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate): Remove m_parentPopup.
     14        * Api/WebPage_p.h:
     15        (WebPagePrivate):
     16        * WebCoreSupport/ChromeClientBlackBerry.cpp:
     17        (WebCore::ChromeClientBlackBerry::closePagePopup):
     18        * WebCoreSupport/PagePopupBlackBerry.cpp:
     19        (WebCore::PagePopupBlackBerry::init): Remove the setParentPopup() call.
     20        (WebCore::PagePopupBlackBerry::closePopup): Clear the reference in WebPagePrivate.
     21        * WebCoreSupport/SelectPopupClient.cpp:
     22        (WebCore::SelectPopupClient::setValueAndClosePopup): Add an assert for valid m_element.
     23
    1242012-07-09  Mike Lattanzio  <mlattanzio@rim.com>
    225
  • trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp

    r122035 r122162  
    317317void ChromeClientBlackBerry::closePagePopup(PagePopup*)
    318318{
    319     if (hasOpenedPopup()) {
    320         PagePopupBlackBerry* webPopup = m_webPagePrivate->m_webPage->popup();
    321         webPopup->closePopup();
    322         m_webPagePrivate->m_webPage->popupClosed();
    323     }
     319    if (!hasOpenedPopup())
     320        return;
     321
     322    PagePopupBlackBerry* webPopup = m_webPagePrivate->m_webPage->popup();
     323    webPopup->closePopup();
    324324}
    325325
  • trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp

    r121381 r122162  
    6868
    6969    installDomFunction(webpage->d->mainFrame());
    70 
    71     webpage->d->setParentPopup(this);
    7270
    7371    return true;
     
    163161    m_client->didClosePopup();
    164162    m_webPagePrivate->client()->closePopupWebView();
     163    m_webPagePrivate->m_webPage->popupClosed();
    165164}
    166165
  • trunk/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp

    r121630 r122162  
    145145void SelectPopupClient::setValueAndClosePopup(int, const String& stringValue)
    146146{
    147 
     147    ASSERT(m_element);
    148148    ASSERT(m_size == stringValue.length());
    149149
Note: See TracChangeset for help on using the changeset viewer.