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

Side by Side Diff: third_party/WebKit/Source/core/frame/Frame.cpp

Issue 1802953003: RemoteBridgeFrameOwner: keep better track of the attached frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't call virtuals indirectly from a ctor. Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 childrenToDetach.reserveCapacity(tree().childCount()); 107 childrenToDetach.reserveCapacity(tree().childCount());
108 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi bling()) 108 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi bling())
109 childrenToDetach.append(child); 109 childrenToDetach.append(child);
110 for (const auto& child : childrenToDetach) 110 for (const auto& child : childrenToDetach)
111 child->detach(FrameDetachType::Remove); 111 child->detach(FrameDetachType::Remove);
112 } 112 }
113 113
114 void Frame::disconnectOwnerElement() 114 void Frame::disconnectOwnerElement()
115 { 115 {
116 if (m_owner) { 116 if (m_owner) {
117 if (m_owner->isLocal()) 117 m_owner->clearContentFrame();
118 toHTMLFrameOwnerElement(m_owner)->clearContentFrame(); 118 m_owner = nullptr;
haraken 2016/03/16 14:17:41 Is there any assert to check that m_owner's conten
dcheng 2016/03/16 16:51:41 Done. I did it in the two "real" FrameOwner implem
119 } 119 }
120 m_owner = nullptr;
121 } 120 }
122 121
123 Page* Frame::page() const 122 Page* Frame::page() const
124 { 123 {
125 if (m_host) 124 if (m_host)
126 return &m_host->page(); 125 return &m_host->page();
127 return nullptr; 126 return nullptr;
128 } 127 }
129 128
130 FrameHost* Frame::host() const 129 FrameHost* Frame::host() const
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 , m_isLoading(false) 301 , m_isLoading(false)
303 { 302 {
304 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter); 303 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter);
305 304
306 ASSERT(page()); 305 ASSERT(page());
307 306
308 #ifndef NDEBUG 307 #ifndef NDEBUG
309 frameCounter().increment(); 308 frameCounter().increment();
310 #endif 309 #endif
311 310
312 if (m_owner) { 311 if (m_owner)
313 if (m_owner->isLocal()) 312 m_owner->setContentFrame(*this);
314 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this); 313 else
315 } else {
316 page()->setMainFrame(this); 314 page()->setMainFrame(this);
317 }
318 } 315 }
319 316
320 } // namespace blink 317 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698