| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 } | 276 } |
| 277 | 277 |
| 278 bool HTMLFrameOwnerElement::loadOrRedirectSubframe(const KURL& url, const Atomic
String& frameName, bool replaceCurrentItem) | 278 bool HTMLFrameOwnerElement::loadOrRedirectSubframe(const KURL& url, const Atomic
String& frameName, bool replaceCurrentItem) |
| 279 { | 279 { |
| 280 RefPtrWillBeRawPtr<LocalFrame> parentFrame = document().frame(); | 280 RefPtrWillBeRawPtr<LocalFrame> parentFrame = document().frame(); |
| 281 if (contentFrame()) { | 281 if (contentFrame()) { |
| 282 contentFrame()->navigate(document(), url, replaceCurrentItem, UserGestur
eStatus::None); | 282 contentFrame()->navigate(document(), url, replaceCurrentItem, UserGestur
eStatus::None); |
| 283 return true; | 283 return true; |
| 284 } | 284 } |
| 285 | 285 |
| 286 if (!document().securityOrigin()->canDisplay(url)) { | 286 if (!document().getSecurityOrigin()->canDisplay(url)) { |
| 287 FrameLoader::reportLocalLoadFailed(parentFrame.get(), url.getString()); | 287 FrameLoader::reportLocalLoadFailed(parentFrame.get(), url.getString()); |
| 288 return false; | 288 return false; |
| 289 } | 289 } |
| 290 | 290 |
| 291 if (!SubframeLoadingDisabler::canLoadFrame(*this)) | 291 if (!SubframeLoadingDisabler::canLoadFrame(*this)) |
| 292 return false; | 292 return false; |
| 293 | 293 |
| 294 if (document().frame()->host()->subframeCount() >= FrameHost::maxNumberOfFra
mes) | 294 if (document().frame()->host()->subframeCount() >= FrameHost::maxNumberOfFra
mes) |
| 295 return false; | 295 return false; |
| 296 | 296 |
| 297 FrameLoadRequest frameLoadRequest(&document(), url, "_self", CheckContentSec
urityPolicy); | 297 FrameLoadRequest frameLoadRequest(&document(), url, "_self", CheckContentSec
urityPolicy); |
| 298 | 298 |
| 299 ReferrerPolicy policy = referrerPolicyAttribute(); | 299 ReferrerPolicy policy = referrerPolicyAttribute(); |
| 300 if (policy != ReferrerPolicyDefault) | 300 if (policy != ReferrerPolicyDefault) |
| 301 frameLoadRequest.resourceRequest().setHTTPReferrer(SecurityPolicy::gener
ateReferrer(policy, url, document().outgoingReferrer())); | 301 frameLoadRequest.resourceRequest().setHTTPReferrer(SecurityPolicy::gener
ateReferrer(policy, url, document().outgoingReferrer())); |
| 302 | 302 |
| 303 return parentFrame->loader().client()->createFrame(frameLoadRequest, frameNa
me, this); | 303 return parentFrame->loader().client()->createFrame(frameLoadRequest, frameNa
me, this); |
| 304 } | 304 } |
| 305 | 305 |
| 306 DEFINE_TRACE(HTMLFrameOwnerElement) | 306 DEFINE_TRACE(HTMLFrameOwnerElement) |
| 307 { | 307 { |
| 308 visitor->trace(m_contentFrame); | 308 visitor->trace(m_contentFrame); |
| 309 visitor->trace(m_widget); | 309 visitor->trace(m_widget); |
| 310 HTMLElement::trace(visitor); | 310 HTMLElement::trace(visitor); |
| 311 FrameOwner::trace(visitor); | 311 FrameOwner::trace(visitor); |
| 312 } | 312 } |
| 313 | 313 |
| 314 | 314 |
| 315 } // namespace blink | 315 } // namespace blink |
| OLD | NEW |