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

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

Issue 2842253002: Move ReportLocalLoadFailed to ExecutionContext (Closed)
Patch Set: +comment Created 3 years, 7 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 bool replace_current_item) { 329 bool replace_current_item) {
330 UpdateContainerPolicy(); 330 UpdateContainerPolicy();
331 331
332 LocalFrame* parent_frame = GetDocument().GetFrame(); 332 LocalFrame* parent_frame = GetDocument().GetFrame();
333 if (ContentFrame()) { 333 if (ContentFrame()) {
334 ContentFrame()->Navigate(GetDocument(), url, replace_current_item, 334 ContentFrame()->Navigate(GetDocument(), url, replace_current_item,
335 UserGestureStatus::kNone); 335 UserGestureStatus::kNone);
336 return true; 336 return true;
337 } 337 }
338 338
339 if (!GetDocument().GetSecurityOrigin()->CanDisplay(url)) {
340 FrameLoader::ReportLocalLoadFailed(parent_frame, url.GetString());
341 return false;
342 }
343
344 if (!SubframeLoadingDisabler::CanLoadFrame(*this)) 339 if (!SubframeLoadingDisabler::CanLoadFrame(*this))
345 return false; 340 return false;
346 341
347 if (GetDocument().GetFrame()->GetPage()->SubframeCount() >= 342 if (GetDocument().GetFrame()->GetPage()->SubframeCount() >=
348 Page::kMaxNumberOfFrames) 343 Page::kMaxNumberOfFrames)
349 return false; 344 return false;
350 345
351 FrameLoadRequest frame_load_request(&GetDocument(), ResourceRequest(url), 346 FrameLoadRequest frame_load_request(&GetDocument(), ResourceRequest(url),
352 "_self", kCheckContentSecurityPolicy); 347 "_self", kCheckContentSecurityPolicy);
353 348
354 ReferrerPolicy policy = ReferrerPolicyAttribute(); 349 ReferrerPolicy policy = ReferrerPolicyAttribute();
355 if (policy != kReferrerPolicyDefault) 350 if (policy != kReferrerPolicyDefault)
356 frame_load_request.GetResourceRequest().SetHTTPReferrer( 351 frame_load_request.GetResourceRequest().SetHTTPReferrer(
357 SecurityPolicy::GenerateReferrer(policy, url, 352 SecurityPolicy::GenerateReferrer(policy, url,
358 GetDocument().OutgoingReferrer())); 353 GetDocument().OutgoingReferrer()));
359 354
360 return parent_frame->Loader().Client()->CreateFrame(frame_load_request, 355 return parent_frame->Loader().Client()->CreateFrame(frame_load_request,
361 frame_name, this); 356 frame_name, this);
362 } 357 }
363 358
364 DEFINE_TRACE(HTMLFrameOwnerElement) { 359 DEFINE_TRACE(HTMLFrameOwnerElement) {
365 visitor->Trace(content_frame_); 360 visitor->Trace(content_frame_);
366 visitor->Trace(widget_); 361 visitor->Trace(widget_);
367 HTMLElement::Trace(visitor); 362 HTMLElement::Trace(visitor);
368 FrameOwner::Trace(visitor); 363 FrameOwner::Trace(visitor);
369 } 364 }
370 365
371 } // namespace blink 366 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698