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

Side by Side Diff: third_party/WebKit/Source/web/WebFrame.cpp

Issue 2737243003: Remove FrameHost::subFrameCount() (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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp ('k') | 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "public/web/WebFrame.h" 5 #include "public/web/WebFrame.h"
6 6
7 #include "bindings/core/v8/WindowProxyManager.h" 7 #include "bindings/core/v8/WindowProxyManager.h"
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/frame/FrameHost.h" 9 #include "core/frame/FrameHost.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 195 }
196 196
197 if (next) { 197 if (next) {
198 newChild->m_nextSibling = next; 198 newChild->m_nextSibling = next;
199 next->m_previousSibling = newChild; 199 next->m_previousSibling = newChild;
200 } else { 200 } else {
201 m_lastChild = newChild; 201 m_lastChild = newChild;
202 } 202 }
203 203
204 toImplBase()->frame()->tree().invalidateScopedChildCount(); 204 toImplBase()->frame()->tree().invalidateScopedChildCount();
205 toImplBase()->frame()->host()->incrementSubframeCount(); 205 toImplBase()->frame()->page()->incrementSubframeCount();
206 } 206 }
207 207
208 void WebFrame::appendChild(WebFrame* child) { 208 void WebFrame::appendChild(WebFrame* child) {
209 // TODO(dcheng): Original code asserts that the frames have the same Page. 209 // TODO(dcheng): Original code asserts that the frames have the same Page.
210 // We should add an equivalent check... figure out what. 210 // We should add an equivalent check... figure out what.
211 insertAfter(child, m_lastChild); 211 insertAfter(child, m_lastChild);
212 } 212 }
213 213
214 void WebFrame::removeChild(WebFrame* child) { 214 void WebFrame::removeChild(WebFrame* child) {
215 child->m_parent = 0; 215 child->m_parent = 0;
216 216
217 if (m_firstChild == child) 217 if (m_firstChild == child)
218 m_firstChild = child->m_nextSibling; 218 m_firstChild = child->m_nextSibling;
219 else 219 else
220 child->m_previousSibling->m_nextSibling = child->m_nextSibling; 220 child->m_previousSibling->m_nextSibling = child->m_nextSibling;
221 221
222 if (m_lastChild == child) 222 if (m_lastChild == child)
223 m_lastChild = child->m_previousSibling; 223 m_lastChild = child->m_previousSibling;
224 else 224 else
225 child->m_nextSibling->m_previousSibling = child->m_previousSibling; 225 child->m_nextSibling->m_previousSibling = child->m_previousSibling;
226 226
227 child->m_previousSibling = child->m_nextSibling = 0; 227 child->m_previousSibling = child->m_nextSibling = 0;
228 228
229 toImplBase()->frame()->tree().invalidateScopedChildCount(); 229 toImplBase()->frame()->tree().invalidateScopedChildCount();
230 toImplBase()->frame()->host()->decrementSubframeCount(); 230 toImplBase()->frame()->page()->decrementSubframeCount();
231 } 231 }
232 232
233 void WebFrame::setParent(WebFrame* parent) { 233 void WebFrame::setParent(WebFrame* parent) {
234 m_parent = parent; 234 m_parent = parent;
235 } 235 }
236 236
237 WebFrame* WebFrame::parent() const { 237 WebFrame* WebFrame::parent() const {
238 return m_parent; 238 return m_parent;
239 } 239 }
240 240
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 for (WebFrame* child = frame->firstChild(); child; 312 for (WebFrame* child = frame->firstChild(); child;
313 child = child->nextSibling()) 313 child = child->nextSibling())
314 traceFrame(visitor, child); 314 traceFrame(visitor, child);
315 } 315 }
316 316
317 void WebFrame::close() { 317 void WebFrame::close() {
318 m_openedFrameTracker->dispose(); 318 m_openedFrameTracker->dispose();
319 } 319 }
320 320
321 } // namespace blink 321 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698