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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1858533002: Introduce WebCachePolicy to merge cache policy enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hiroshige review Created 4 years, 8 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) 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
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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 // If we're moving in the back/forward list, we might want to replace the co ntent 1589 // If we're moving in the back/forward list, we might want to replace the co ntent
1591 // of this child frame with whatever was there at that point. 1590 // of this child frame with whatever was there at that point.
1592 RawPtr<HistoryItem> childItem = nullptr; 1591 RawPtr<HistoryItem> childItem = nullptr;
1593 if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->documen t()->loadEventFinished()) 1592 if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->documen t()->loadEventFinished())
1594 childItem = RawPtr<HistoryItem>(webframeChild->client()->historyItemForN ewChildFrame()); 1593 childItem = RawPtr<HistoryItem>(webframeChild->client()->historyItemForN ewChildFrame());
1595 1594
1596 FrameLoadRequest newRequest = request; 1595 FrameLoadRequest newRequest = request;
1597 FrameLoadType loadType = FrameLoadTypeStandard; 1596 FrameLoadType loadType = FrameLoadTypeStandard;
1598 if (childItem) { 1597 if (childItem) {
1599 newRequest = FrameLoadRequest(request.originDocument(), 1598 newRequest = FrameLoadRequest(request.originDocument(),
1600 FrameLoader::resourceRequestFromHistoryItem(childItem.get(), UseProt ocolCachePolicy)); 1599 FrameLoader::resourceRequestFromHistoryItem(childItem.get(), WebCach ePolicy::UseProtocolCachePolicy));
1601 loadType = FrameLoadTypeInitialHistoryLoad; 1600 loadType = FrameLoadTypeInitialHistoryLoad;
1602 } 1601 }
1603 webframeChild->frame()->loader().load(newRequest, loadType, childItem.get()) ; 1602 webframeChild->frame()->loader().load(newRequest, loadType, childItem.get()) ;
1604 1603
1605 // Note a synchronous navigation (about:blank) would have already processed 1604 // Note a synchronous navigation (about:blank) would have already processed
1606 // onload, so it is possible for the child frame to have already been 1605 // onload, so it is possible for the child frame to have already been
1607 // detached by script in the page. 1606 // detached by script in the page.
1608 if (!webframeChild->parent()) 1607 if (!webframeChild->parent())
1609 return nullptr; 1608 return nullptr;
1610 return webframeChild->frame(); 1609 return webframeChild->frame();
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1889 } 1888 }
1890 1889
1891 void WebLocalFrameImpl::sendPings(const WebNode& contextNode, const WebURL& dest inationURL) 1890 void WebLocalFrameImpl::sendPings(const WebNode& contextNode, const WebURL& dest inationURL)
1892 { 1891 {
1893 DCHECK(frame()); 1892 DCHECK(frame());
1894 Element* anchor = contextNode.constUnwrap<Node>()->enclosingLinkEventParentO rSelf(); 1893 Element* anchor = contextNode.constUnwrap<Node>()->enclosingLinkEventParentO rSelf();
1895 if (isHTMLAnchorElement(anchor)) 1894 if (isHTMLAnchorElement(anchor))
1896 toHTMLAnchorElement(anchor)->sendPings(destinationURL); 1895 toHTMLAnchorElement(anchor)->sendPings(destinationURL);
1897 } 1896 }
1898 1897
1899 WebURLRequest WebLocalFrameImpl::requestFromHistoryItem(const WebHistoryItem& it em, 1898 WebURLRequest WebLocalFrameImpl::requestFromHistoryItem(const WebHistoryItem& it em, WebCachePolicy cachePolicy) const
1900 WebURLRequest::CachePolicy cachePolicy) const
1901 { 1899 {
1902 RawPtr<HistoryItem> historyItem = RawPtr<HistoryItem>(item); 1900 RawPtr<HistoryItem> historyItem = RawPtr<HistoryItem>(item);
1903 ResourceRequest request = FrameLoader::resourceRequestFromHistoryItem( 1901 ResourceRequest request = FrameLoader::resourceRequestFromHistoryItem(
1904 historyItem.get(), static_cast<ResourceRequestCachePolicy>(cachePolicy)) ; 1902 historyItem.get(), cachePolicy);
1905 return WrappedResourceRequest(request); 1903 return WrappedResourceRequest(request);
1906 } 1904 }
1907 1905
1908 WebURLRequest WebLocalFrameImpl::requestForReload(WebFrameLoadType loadType, 1906 WebURLRequest WebLocalFrameImpl::requestForReload(WebFrameLoadType loadType,
1909 const WebURL& overrideUrl) const 1907 const WebURL& overrideUrl) const
1910 { 1908 {
1911 DCHECK(frame()); 1909 DCHECK(frame());
1912 ResourceRequest request = frame()->loader().resourceRequestForReload( 1910 ResourceRequest request = frame()->loader().resourceRequestForReload(
1913 static_cast<FrameLoadType>(loadType), overrideUrl); 1911 static_cast<FrameLoadType>(loadType), overrideUrl);
1914 return WrappedResourceRequest(request); 1912 return WrappedResourceRequest(request);
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 return WebSandboxFlags::None; 2172 return WebSandboxFlags::None;
2175 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2173 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2176 } 2174 }
2177 2175
2178 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) 2176 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags)
2179 { 2177 {
2180 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2178 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2181 } 2179 }
2182 2180
2183 } // namespace blink 2181 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.h ('k') | third_party/WebKit/Source/web/WebRemoteFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698