Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 1297883002: Revert of Fix flaky crash in WebPagePopupImpl::closePopup. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 m_pagePopup = nullptr; 1639 m_pagePopup = nullptr;
1640 } 1640 }
1641 enablePopupMouseWheelEventListener(); 1641 enablePopupMouseWheelEventListener();
1642 return m_pagePopup.get(); 1642 return m_pagePopup.get();
1643 } 1643 }
1644 1644
1645 void WebViewImpl::closePagePopup(PagePopup* popup) 1645 void WebViewImpl::closePagePopup(PagePopup* popup)
1646 { 1646 {
1647 ASSERT(popup); 1647 ASSERT(popup);
1648 WebPagePopupImpl* popupImpl = toWebPagePopupImpl(popup); 1648 WebPagePopupImpl* popupImpl = toWebPagePopupImpl(popup);
1649 // It's possible that closePagePopup is called from pagePopup->closePopup() 1649 ASSERT(m_pagePopup.get() == popupImpl);
1650 // below because the main frame of the page popup can have the last 1650 if (m_pagePopup.get() != popupImpl)
1651 // reference to the pagePopupOwner Element. So, we clear m_pagePopup before
1652 // pagePopup->closePopup(), and do nothing if m_pagepopup is nullptr.
1653 ASSERT(!m_pagePopup || m_pagePopup.get() == popupImpl);
1654 if (!m_pagePopup || m_pagePopup.get() != popupImpl)
1655 return; 1651 return;
1656 RefPtr<WebPagePopupImpl> pagePopup = m_pagePopup.release(); 1652 m_pagePopup->closePopup();
1657 pagePopup->closePopup(); 1653 m_pagePopup = nullptr;
1658 disablePopupMouseWheelEventListener(); 1654 disablePopupMouseWheelEventListener();
1659 } 1655 }
1660 1656
1661 void WebViewImpl::cancelPagePopup() 1657 void WebViewImpl::cancelPagePopup()
1662 { 1658 {
1663 if (m_pagePopup) 1659 if (m_pagePopup)
1664 m_pagePopup->cancel(); 1660 m_pagePopup->cancel();
1665 } 1661 }
1666 1662
1667 void WebViewImpl::enablePopupMouseWheelEventListener() 1663 void WebViewImpl::enablePopupMouseWheelEventListener()
(...skipping 2837 matching lines...) Expand 10 before | Expand all | Expand 10 after
4505 if (m_pageColorOverlay) 4501 if (m_pageColorOverlay)
4506 m_pageColorOverlay->update(); 4502 m_pageColorOverlay->update();
4507 if (m_inspectorOverlay) { 4503 if (m_inspectorOverlay) {
4508 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); 4504 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay();
4509 if (inspectorPageOverlay) 4505 if (inspectorPageOverlay)
4510 inspectorPageOverlay->update(); 4506 inspectorPageOverlay->update();
4511 } 4507 }
4512 } 4508 }
4513 4509
4514 } // namespace blink 4510 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698