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 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 frame()->document()->fetcher()->reloadLoFiImages(); | 884 frame()->document()->fetcher()->reloadLoFiImages(); |
885 } | 885 } |
886 | 886 |
887 void WebLocalFrameImpl::loadRequest(const WebURLRequest& request) | 887 void WebLocalFrameImpl::loadRequest(const WebURLRequest& request) |
888 { | 888 { |
889 // TODO(clamy): Remove this function once RenderFrame calls load for all | 889 // TODO(clamy): Remove this function once RenderFrame calls load for all |
890 // requests. | 890 // requests. |
891 load(request, WebFrameLoadType::Standard, WebHistoryItem(), WebHistoryDiffer
entDocumentLoad, false); | 891 load(request, WebFrameLoadType::Standard, WebHistoryItem(), WebHistoryDiffer
entDocumentLoad, false); |
892 } | 892 } |
893 | 893 |
894 void WebLocalFrameImpl::loadHistoryItem(const WebHistoryItem& item, WebHistoryLo
adType loadType, | 894 void WebLocalFrameImpl::loadHistoryItem(const WebHistoryItem& item, WebHistoryLo
adType loadType, WebCachePolicy cachePolicy) |
895 WebURLRequest::CachePolicy cachePolicy) | |
896 { | 895 { |
897 // TODO(clamy): Remove this function once RenderFrame calls load for all | 896 // TODO(clamy): Remove this function once RenderFrame calls load for all |
898 // requests. | 897 // requests. |
899 WebURLRequest request = requestFromHistoryItem(item, cachePolicy); | 898 WebURLRequest request = requestFromHistoryItem(item, cachePolicy); |
900 load(request, WebFrameLoadType::BackForward, item, loadType, false); | 899 load(request, WebFrameLoadType::BackForward, item, loadType, false); |
901 } | 900 } |
902 | 901 |
903 void WebLocalFrameImpl::loadHTMLString(const WebData& data, const WebURL& baseUR
L, const WebURL& unreachableURL, bool replace) | 902 void WebLocalFrameImpl::loadHTMLString(const WebData& data, const WebURL& baseUR
L, const WebURL& unreachableURL, bool replace) |
904 { | 903 { |
905 DCHECK(frame()); | 904 DCHECK(frame()); |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 // If we're moving in the back/forward list, we might want to replace the co
ntent | 1588 // If we're moving in the back/forward list, we might want to replace the co
ntent |
1590 // of this child frame with whatever was there at that point. | 1589 // of this child frame with whatever was there at that point. |
1591 RawPtr<HistoryItem> childItem = nullptr; | 1590 RawPtr<HistoryItem> childItem = nullptr; |
1592 if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->documen
t()->loadEventFinished()) | 1591 if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->documen
t()->loadEventFinished()) |
1593 childItem = RawPtr<HistoryItem>(webframeChild->client()->historyItemForN
ewChildFrame()); | 1592 childItem = RawPtr<HistoryItem>(webframeChild->client()->historyItemForN
ewChildFrame()); |
1594 | 1593 |
1595 FrameLoadRequest newRequest = request; | 1594 FrameLoadRequest newRequest = request; |
1596 FrameLoadType loadType = FrameLoadTypeStandard; | 1595 FrameLoadType loadType = FrameLoadTypeStandard; |
1597 if (childItem) { | 1596 if (childItem) { |
1598 newRequest = FrameLoadRequest(request.originDocument(), | 1597 newRequest = FrameLoadRequest(request.originDocument(), |
1599 FrameLoader::resourceRequestFromHistoryItem(childItem.get(), UseProt
ocolCachePolicy)); | 1598 FrameLoader::resourceRequestFromHistoryItem(childItem.get(), WebCach
ePolicy::UseProtocolCachePolicy)); |
1600 loadType = FrameLoadTypeInitialHistoryLoad; | 1599 loadType = FrameLoadTypeInitialHistoryLoad; |
1601 } | 1600 } |
1602 webframeChild->frame()->loader().load(newRequest, loadType, childItem.get())
; | 1601 webframeChild->frame()->loader().load(newRequest, loadType, childItem.get())
; |
1603 | 1602 |
1604 // Note a synchronous navigation (about:blank) would have already processed | 1603 // Note a synchronous navigation (about:blank) would have already processed |
1605 // onload, so it is possible for the child frame to have already been | 1604 // onload, so it is possible for the child frame to have already been |
1606 // detached by script in the page. | 1605 // detached by script in the page. |
1607 if (!webframeChild->parent()) | 1606 if (!webframeChild->parent()) |
1608 return nullptr; | 1607 return nullptr; |
1609 return webframeChild->frame(); | 1608 return webframeChild->frame(); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1888 } | 1887 } |
1889 | 1888 |
1890 void WebLocalFrameImpl::sendPings(const WebNode& contextNode, const WebURL& dest
inationURL) | 1889 void WebLocalFrameImpl::sendPings(const WebNode& contextNode, const WebURL& dest
inationURL) |
1891 { | 1890 { |
1892 DCHECK(frame()); | 1891 DCHECK(frame()); |
1893 Element* anchor = contextNode.constUnwrap<Node>()->enclosingLinkEventParentO
rSelf(); | 1892 Element* anchor = contextNode.constUnwrap<Node>()->enclosingLinkEventParentO
rSelf(); |
1894 if (isHTMLAnchorElement(anchor)) | 1893 if (isHTMLAnchorElement(anchor)) |
1895 toHTMLAnchorElement(anchor)->sendPings(destinationURL); | 1894 toHTMLAnchorElement(anchor)->sendPings(destinationURL); |
1896 } | 1895 } |
1897 | 1896 |
1898 WebURLRequest WebLocalFrameImpl::requestFromHistoryItem(const WebHistoryItem& it
em, | 1897 WebURLRequest WebLocalFrameImpl::requestFromHistoryItem(const WebHistoryItem& it
em, WebCachePolicy cachePolicy) const |
1899 WebURLRequest::CachePolicy cachePolicy) const | |
1900 { | 1898 { |
1901 RawPtr<HistoryItem> historyItem = RawPtr<HistoryItem>(item); | 1899 RawPtr<HistoryItem> historyItem = RawPtr<HistoryItem>(item); |
1902 ResourceRequest request = FrameLoader::resourceRequestFromHistoryItem( | 1900 ResourceRequest request = FrameLoader::resourceRequestFromHistoryItem( |
1903 historyItem.get(), static_cast<ResourceRequestCachePolicy>(cachePolicy))
; | 1901 historyItem.get(), cachePolicy); |
1904 return WrappedResourceRequest(request); | 1902 return WrappedResourceRequest(request); |
1905 } | 1903 } |
1906 | 1904 |
1907 WebURLRequest WebLocalFrameImpl::requestForReload(WebFrameLoadType loadType, | 1905 WebURLRequest WebLocalFrameImpl::requestForReload(WebFrameLoadType loadType, |
1908 const WebURL& overrideUrl) const | 1906 const WebURL& overrideUrl) const |
1909 { | 1907 { |
1910 DCHECK(frame()); | 1908 DCHECK(frame()); |
1911 ResourceRequest request = frame()->loader().resourceRequestForReload( | 1909 ResourceRequest request = frame()->loader().resourceRequestForReload( |
1912 static_cast<FrameLoadType>(loadType), overrideUrl); | 1910 static_cast<FrameLoadType>(loadType), overrideUrl); |
1913 return WrappedResourceRequest(request); | 1911 return WrappedResourceRequest(request); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2173 return WebSandboxFlags::None; | 2171 return WebSandboxFlags::None; |
2174 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2172 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
2175 } | 2173 } |
2176 | 2174 |
2177 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) | 2175 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) |
2178 { | 2176 { |
2179 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); | 2177 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); |
2180 } | 2178 } |
2181 | 2179 |
2182 } // namespace blink | 2180 } // namespace blink |
OLD | NEW |