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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp

Issue 2739033003: Move FrameHost::m_subframeCount to Page (Closed)
Patch Set: 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 15 matching lines...) Expand all
26 #include "core/dom/ExceptionCode.h" 26 #include "core/dom/ExceptionCode.h"
27 #include "core/events/Event.h" 27 #include "core/events/Event.h"
28 #include "core/frame/FrameHost.h" 28 #include "core/frame/FrameHost.h"
29 #include "core/frame/FrameView.h" 29 #include "core/frame/FrameView.h"
30 #include "core/frame/LocalFrame.h" 30 #include "core/frame/LocalFrame.h"
31 #include "core/frame/LocalFrameClient.h" 31 #include "core/frame/LocalFrameClient.h"
32 #include "core/layout/LayoutPart.h" 32 #include "core/layout/LayoutPart.h"
33 #include "core/layout/api/LayoutPartItem.h" 33 #include "core/layout/api/LayoutPartItem.h"
34 #include "core/loader/FrameLoadRequest.h" 34 #include "core/loader/FrameLoadRequest.h"
35 #include "core/loader/FrameLoader.h" 35 #include "core/loader/FrameLoader.h"
36 #include "core/page/Page.h"
36 #include "core/plugins/PluginView.h" 37 #include "core/plugins/PluginView.h"
37 #include "platform/weborigin/SecurityOrigin.h" 38 #include "platform/weborigin/SecurityOrigin.h"
38 39
39 namespace blink { 40 namespace blink {
40 41
41 typedef HeapHashMap<Member<FrameViewBase>, Member<FrameView>> 42 typedef HeapHashMap<Member<FrameViewBase>, Member<FrameView>>
42 FrameViewBaseToParentMap; 43 FrameViewBaseToParentMap;
43 static FrameViewBaseToParentMap& widgetNewParentMap() { 44 static FrameViewBaseToParentMap& widgetNewParentMap() {
44 DEFINE_STATIC_LOCAL(FrameViewBaseToParentMap, map, 45 DEFINE_STATIC_LOCAL(FrameViewBaseToParentMap, map,
45 (new FrameViewBaseToParentMap)); 46 (new FrameViewBaseToParentMap));
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 306 }
306 307
307 if (!document().getSecurityOrigin()->canDisplay(url)) { 308 if (!document().getSecurityOrigin()->canDisplay(url)) {
308 FrameLoader::reportLocalLoadFailed(parentFrame, url.getString()); 309 FrameLoader::reportLocalLoadFailed(parentFrame, url.getString());
309 return false; 310 return false;
310 } 311 }
311 312
312 if (!SubframeLoadingDisabler::canLoadFrame(*this)) 313 if (!SubframeLoadingDisabler::canLoadFrame(*this))
313 return false; 314 return false;
314 315
315 if (document().frame()->host()->subframeCount() >= 316 if (document().frame()->host()->subframeCount() >= Page::maxNumberOfFrames)
316 FrameHost::maxNumberOfFrames)
317 return false; 317 return false;
318 318
319 FrameLoadRequest frameLoadRequest(&document(), url, "_self", 319 FrameLoadRequest frameLoadRequest(&document(), url, "_self",
320 CheckContentSecurityPolicy); 320 CheckContentSecurityPolicy);
321 321
322 ReferrerPolicy policy = referrerPolicyAttribute(); 322 ReferrerPolicy policy = referrerPolicyAttribute();
323 if (policy != ReferrerPolicyDefault) 323 if (policy != ReferrerPolicyDefault)
324 frameLoadRequest.resourceRequest().setHTTPReferrer( 324 frameLoadRequest.resourceRequest().setHTTPReferrer(
325 SecurityPolicy::generateReferrer(policy, url, 325 SecurityPolicy::generateReferrer(policy, url,
326 document().outgoingReferrer())); 326 document().outgoingReferrer()));
327 327
328 return parentFrame->loader().client()->createFrame(frameLoadRequest, 328 return parentFrame->loader().client()->createFrame(frameLoadRequest,
329 frameName, this); 329 frameName, this);
330 } 330 }
331 331
332 DEFINE_TRACE(HTMLFrameOwnerElement) { 332 DEFINE_TRACE(HTMLFrameOwnerElement) {
333 visitor->trace(m_contentFrame); 333 visitor->trace(m_contentFrame);
334 visitor->trace(m_widget); 334 visitor->trace(m_widget);
335 HTMLElement::trace(visitor); 335 HTMLElement::trace(visitor);
336 FrameOwner::trace(visitor); 336 FrameOwner::trace(visitor);
337 } 337 }
338 338
339 } // namespace blink 339 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698