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