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

Unified Diff: third_party/WebKit/Source/core/frame/Frame.cpp

Issue 2748603002: Add a lifecycle state machine for Page (Closed)
Patch Set: Rebase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/Frame.h ('k') | third_party/WebKit/Source/core/frame/FrameLifecycle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/Frame.cpp
diff --git a/third_party/WebKit/Source/core/frame/Frame.cpp b/third_party/WebKit/Source/core/frame/Frame.cpp
index a3d935d830d1188a95059f777c4b59cf84ad33d0..23bd1e6edaf06175582db6102feaafe5a3b8d4a7 100644
--- a/third_party/WebKit/Source/core/frame/Frame.cpp
+++ b/third_party/WebKit/Source/core/frame/Frame.cpp
@@ -58,7 +58,8 @@ using namespace HTMLNames;
Frame::~Frame() {
InstanceCounters::decrementCounter(InstanceCounters::FrameCounter);
- ASSERT(!m_owner);
+ DCHECK(!m_owner);
+ DCHECK_EQ(m_lifecycle.state(), FrameLifecycle::Detached);
}
DEFINE_TRACE(Frame) {
@@ -71,7 +72,10 @@ DEFINE_TRACE(Frame) {
}
void Frame::detach(FrameDetachType type) {
- ASSERT(m_client);
+ DCHECK(m_client);
+ // By the time this method is called, the subclasses should have already
+ // advanced to the Detaching state.
+ DCHECK_EQ(m_lifecycle.state(), FrameLifecycle::Detaching);
m_client->setOpener(0);
disconnectOwnerElement();
// After this, we must no longer talk to the client since this clears
« no previous file with comments | « third_party/WebKit/Source/core/frame/Frame.h ('k') | third_party/WebKit/Source/core/frame/FrameLifecycle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698