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

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

Issue 1291303002: 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 ASSERT(m_pagePopup.get() == popupImpl); 1649 // It's possible that closePagePopup is called from pagePopup->closePopup()
1650 if (m_pagePopup.get() != popupImpl) 1650 // below because the main frame of the page popup can have the last
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)
1651 return; 1655 return;
1652 m_pagePopup->closePopup(); 1656 RefPtr<WebPagePopupImpl> pagePopup = m_pagePopup.release();
1653 m_pagePopup = nullptr; 1657 pagePopup->closePopup();
1654 disablePopupMouseWheelEventListener(); 1658 disablePopupMouseWheelEventListener();
1655 } 1659 }
1656 1660
1657 void WebViewImpl::cancelPagePopup() 1661 void WebViewImpl::cancelPagePopup()
1658 { 1662 {
1659 if (m_pagePopup) 1663 if (m_pagePopup)
1660 m_pagePopup->cancel(); 1664 m_pagePopup->cancel();
1661 } 1665 }
1662 1666
1663 void WebViewImpl::enablePopupMouseWheelEventListener() 1667 void WebViewImpl::enablePopupMouseWheelEventListener()
(...skipping 2837 matching lines...) Expand 10 before | Expand all | Expand 10 after
4501 if (m_pageColorOverlay) 4505 if (m_pageColorOverlay)
4502 m_pageColorOverlay->update(); 4506 m_pageColorOverlay->update();
4503 if (m_inspectorOverlay) { 4507 if (m_inspectorOverlay) {
4504 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); 4508 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay();
4505 if (inspectorPageOverlay) 4509 if (inspectorPageOverlay)
4506 inspectorPageOverlay->update(); 4510 inspectorPageOverlay->update();
4507 } 4511 }
4508 } 4512 }
4509 4513
4510 } // namespace blink 4514 } // 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