| Index: third_party/WebKit/Source/web/WebPagePopupImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebPagePopupImpl.cpp b/third_party/WebKit/Source/web/WebPagePopupImpl.cpp
|
| index 7a9d696d6a124aa000f0dff8f5159a5281a70f2b..e41a86be8aa332207b6cdbbe12332332e7578a89 100644
|
| --- a/third_party/WebKit/Source/web/WebPagePopupImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebPagePopupImpl.cpp
|
| @@ -518,26 +518,27 @@ void WebPagePopupImpl::close() {
|
| }
|
|
|
| void WebPagePopupImpl::closePopup() {
|
| - // This function can be called in EventDispatchForbiddenScope for the main
|
| - // document, and the following operations dispatch some events. It's safe
|
| - // because web authors can't listen the events.
|
| - EventDispatchForbiddenScope::AllowUserAgentEvents allowEvents;
|
| -
|
| - if (m_page) {
|
| - toLocalFrame(m_page->mainFrame())->loader().stopAllLoaders();
|
| - PagePopupSupplement::uninstall(*toLocalFrame(m_page->mainFrame()));
|
| - }
|
| - bool closeAlreadyCalled = m_closing;
|
| - m_closing = true;
|
| + {
|
| + // This function can be called in EventDispatchForbiddenScope for the main
|
| + // document, and the following operations dispatch some events. It's safe
|
| + // because web authors can't listen the events.
|
| + EventDispatchForbiddenScope::AllowUserAgentEvents allowEvents;
|
| +
|
| + if (m_page) {
|
| + toLocalFrame(m_page->mainFrame())->loader().stopAllLoaders();
|
| + PagePopupSupplement::uninstall(*toLocalFrame(m_page->mainFrame()));
|
| + }
|
| + bool closeAlreadyCalled = m_closing;
|
| + m_closing = true;
|
|
|
| - destroyPage();
|
| + destroyPage();
|
|
|
| - // m_widgetClient might be 0 because this widget might be already closed.
|
| - if (m_widgetClient && !closeAlreadyCalled) {
|
| - // closeWidgetSoon() will call this->close() later.
|
| - m_widgetClient->closeWidgetSoon();
|
| + // m_widgetClient might be 0 because this widget might be already closed.
|
| + if (m_widgetClient && !closeAlreadyCalled) {
|
| + // closeWidgetSoon() will call this->close() later.
|
| + m_widgetClient->closeWidgetSoon();
|
| + }
|
| }
|
| -
|
| m_popupClient->didClosePopup();
|
| m_webView->cleanupPagePopup();
|
| }
|
|
|