OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 bool WebLocalFrameImpl::isViewSourceModeEnabled() const | 985 bool WebLocalFrameImpl::isViewSourceModeEnabled() const |
986 { | 986 { |
987 if (!frame()) | 987 if (!frame()) |
988 return false; | 988 return false; |
989 return frame()->inViewSourceMode(); | 989 return frame()->inViewSourceMode(); |
990 } | 990 } |
991 | 991 |
992 void WebLocalFrameImpl::setReferrerForRequest(WebURLRequest& request, const WebU
RL& referrerURL) | 992 void WebLocalFrameImpl::setReferrerForRequest(WebURLRequest& request, const WebU
RL& referrerURL) |
993 { | 993 { |
994 String referrer = referrerURL.isEmpty() ? frame()->document()->outgoingRefer
rer() : String(referrerURL.string()); | 994 String referrer = referrerURL.isEmpty() ? frame()->document()->outgoingRefer
rer() : String(referrerURL.string()); |
995 request.toMutableResourceRequest().setHTTPReferrer(SecurityPolicy::generateR
eferrer(frame()->document()->referrerPolicy(), request.url(), referrer)); | 995 request.toMutableResourceRequest().setHTTPReferrer(SecurityPolicy::generateR
eferrer(frame()->document()->getReferrerPolicy(), request.url(), referrer)); |
996 } | 996 } |
997 | 997 |
998 void WebLocalFrameImpl::dispatchWillSendRequest(WebURLRequest& request) | 998 void WebLocalFrameImpl::dispatchWillSendRequest(WebURLRequest& request) |
999 { | 999 { |
1000 ResourceResponse response; | 1000 ResourceResponse response; |
1001 frame()->loader().client()->dispatchWillSendRequest(0, 0, request.toMutableR
esourceRequest(), response); | 1001 frame()->loader().client()->dispatchWillSendRequest(0, 0, request.toMutableR
esourceRequest(), response); |
1002 } | 1002 } |
1003 | 1003 |
1004 WebURLLoader* WebLocalFrameImpl::createAssociatedURLLoader(const WebURLLoaderOpt
ions& options) | 1004 WebURLLoader* WebLocalFrameImpl::createAssociatedURLLoader(const WebURLLoaderOpt
ions& options) |
1005 { | 1005 { |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 WebTreeScopeType scope = frame()->document() == ownerElement->treeScope() | 1609 WebTreeScopeType scope = frame()->document() == ownerElement->treeScope() |
1610 ? WebTreeScopeType::Document | 1610 ? WebTreeScopeType::Document |
1611 : WebTreeScopeType::Shadow; | 1611 : WebTreeScopeType::Shadow; |
1612 WebFrameOwnerProperties ownerProperties(ownerElement->scrollingMode(), owner
Element->marginWidth(), ownerElement->marginHeight()); | 1612 WebFrameOwnerProperties ownerProperties(ownerElement->scrollingMode(), owner
Element->marginWidth(), ownerElement->marginHeight()); |
1613 // FIXME: Using subResourceAttributeName as fallback is not a perfect | 1613 // FIXME: Using subResourceAttributeName as fallback is not a perfect |
1614 // solution. subResourceAttributeName returns just one attribute name. The | 1614 // solution. subResourceAttributeName returns just one attribute name. The |
1615 // element might not have the attribute, and there might be other attributes | 1615 // element might not have the attribute, and there might be other attributes |
1616 // which can identify the element. | 1616 // which can identify the element. |
1617 AtomicString uniqueName = frame()->tree().calculateUniqueNameForNewChildFram
e( | 1617 AtomicString uniqueName = frame()->tree().calculateUniqueNameForNewChildFram
e( |
1618 name, ownerElement->getAttribute(ownerElement->subResourceAttributeName(
))); | 1618 name, ownerElement->getAttribute(ownerElement->subResourceAttributeName(
))); |
1619 RefPtrWillBeRawPtr<WebLocalFrameImpl> webframeChild = toWebLocalFrameImpl(m_
client->createChildFrame(this, scope, name, uniqueName, static_cast<WebSandboxFl
ags>(ownerElement->sandboxFlags()), ownerProperties)); | 1619 RefPtrWillBeRawPtr<WebLocalFrameImpl> webframeChild = toWebLocalFrameImpl(m_
client->createChildFrame(this, scope, name, uniqueName, static_cast<WebSandboxFl
ags>(ownerElement->getSandboxFlags()), ownerProperties)); |
1620 if (!webframeChild) | 1620 if (!webframeChild) |
1621 return nullptr; | 1621 return nullptr; |
1622 | 1622 |
1623 webframeChild->initializeCoreFrame(frame()->host(), ownerElement, name, uniq
ueName); | 1623 webframeChild->initializeCoreFrame(frame()->host(), ownerElement, name, uniq
ueName); |
1624 // Initializing the core frame may cause the new child to be detached, since | 1624 // Initializing the core frame may cause the new child to be detached, since |
1625 // it may dispatch a load event in the parent. | 1625 // it may dispatch a load event in the parent. |
1626 if (!webframeChild->parent()) | 1626 if (!webframeChild->parent()) |
1627 return nullptr; | 1627 return nullptr; |
1628 | 1628 |
1629 // If we're moving in the back/forward list, we might want to replace the co
ntent | 1629 // If we're moving in the back/forward list, we might want to replace the co
ntent |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2186 return WebSandboxFlags::None; | 2186 return WebSandboxFlags::None; |
2187 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2187 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
2188 } | 2188 } |
2189 | 2189 |
2190 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) | 2190 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) |
2191 { | 2191 { |
2192 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); | 2192 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); |
2193 } | 2193 } |
2194 | 2194 |
2195 } // namespace blink | 2195 } // namespace blink |
OLD | NEW |