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

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

Issue 1755803002: Ship `referrerpolicy` attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update webexposed layout tests 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) 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 16 matching lines...) Expand all
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/layout/LayoutPart.h" 31 #include "core/layout/LayoutPart.h"
32 #include "core/layout/api/LayoutPartItem.h" 32 #include "core/layout/api/LayoutPartItem.h"
33 #include "core/loader/FrameLoadRequest.h" 33 #include "core/loader/FrameLoadRequest.h"
34 #include "core/loader/FrameLoader.h" 34 #include "core/loader/FrameLoader.h"
35 #include "core/loader/FrameLoaderClient.h" 35 #include "core/loader/FrameLoaderClient.h"
36 #include "core/plugins/PluginView.h" 36 #include "core/plugins/PluginView.h"
37 #include "platform/RuntimeEnabledFeatures.h"
38 #include "platform/weborigin/SecurityOrigin.h" 37 #include "platform/weborigin/SecurityOrigin.h"
39 38
40 namespace blink { 39 namespace blink {
41 40
42 typedef WillBeHeapHashMap<RefPtrWillBeMember<Widget>, RawPtrWillBeMember<FrameVi ew>> WidgetToParentMap; 41 typedef WillBeHeapHashMap<RefPtrWillBeMember<Widget>, RawPtrWillBeMember<FrameVi ew>> WidgetToParentMap;
43 static WidgetToParentMap& widgetNewParentMap() 42 static WidgetToParentMap& widgetNewParentMap()
44 { 43 {
45 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WidgetToParentMap>, map, (adoptPt rWillBeNoop(new WidgetToParentMap()))); 44 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WidgetToParentMap>, map, (adoptPt rWillBeNoop(new WidgetToParentMap())));
46 return *map; 45 return *map;
47 } 46 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 } 289 }
291 290
292 if (!SubframeLoadingDisabler::canLoadFrame(*this)) 291 if (!SubframeLoadingDisabler::canLoadFrame(*this))
293 return false; 292 return false;
294 293
295 if (document().frame()->host()->subframeCount() >= FrameHost::maxNumberOfFra mes) 294 if (document().frame()->host()->subframeCount() >= FrameHost::maxNumberOfFra mes)
296 return false; 295 return false;
297 296
298 FrameLoadRequest frameLoadRequest(&document(), url, "_self", CheckContentSec urityPolicy); 297 FrameLoadRequest frameLoadRequest(&document(), url, "_self", CheckContentSec urityPolicy);
299 298
300 if (RuntimeEnabledFeatures::referrerPolicyAttributeEnabled()) { 299 ReferrerPolicy policy = referrerPolicyAttribute();
301 ReferrerPolicy policy = referrerPolicyAttribute(); 300 if (policy != ReferrerPolicyDefault)
302 if (policy != ReferrerPolicyDefault) 301 frameLoadRequest.resourceRequest().setHTTPReferrer(SecurityPolicy::gener ateReferrer(policy, url, document().outgoingReferrer()));
303 frameLoadRequest.resourceRequest().setHTTPReferrer(SecurityPolicy::g enerateReferrer(policy, url, document().outgoingReferrer()));
304 }
305 302
306 return parentFrame->loader().client()->createFrame(frameLoadRequest, frameNa me, this); 303 return parentFrame->loader().client()->createFrame(frameLoadRequest, frameNa me, this);
307 } 304 }
308 305
309 DEFINE_TRACE(HTMLFrameOwnerElement) 306 DEFINE_TRACE(HTMLFrameOwnerElement)
310 { 307 {
311 visitor->trace(m_contentFrame); 308 visitor->trace(m_contentFrame);
312 visitor->trace(m_widget); 309 visitor->trace(m_widget);
313 HTMLElement::trace(visitor); 310 HTMLElement::trace(visitor);
314 FrameOwner::trace(visitor); 311 FrameOwner::trace(visitor);
315 } 312 }
316 313
317 314
318 } // namespace blink 315 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLAreaElement.idl ('k') | third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698