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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2772753002: Change FrameLoadTypeReload to take FrameLoadTypeReloadMainResource's behavior (Closed)
Patch Set: rebase error fix (replace newly added ReloadMainResource) Created 3 years, 9 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 if (!provider) 711 if (!provider)
712 return media::Context3D(); 712 return media::Context3D();
713 return media::Context3D(provider->ContextGL(), provider->GrContext()); 713 return media::Context3D(provider->ContextGL(), provider->GrContext());
714 } 714 }
715 715
716 WebFrameLoadType ReloadFrameLoadTypeFor( 716 WebFrameLoadType ReloadFrameLoadTypeFor(
717 FrameMsg_Navigate_Type::Value navigation_type) { 717 FrameMsg_Navigate_Type::Value navigation_type) {
718 switch (navigation_type) { 718 switch (navigation_type) {
719 case FrameMsg_Navigate_Type::RELOAD: 719 case FrameMsg_Navigate_Type::RELOAD:
720 case FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL: 720 case FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL:
721 return WebFrameLoadType::ReloadMainResource; 721 return WebFrameLoadType::Reload;
722 722
723 case FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE: 723 case FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE:
724 return WebFrameLoadType::ReloadBypassingCache; 724 return WebFrameLoadType::ReloadBypassingCache;
725 725
726 default: 726 default:
727 NOTREACHED(); 727 NOTREACHED();
728 return WebFrameLoadType::Standard; 728 return WebFrameLoadType::Standard;
729 } 729 }
730 } 730 }
731 731
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after
2290 WebDOMMessageEvent msg_event(serialized_script_value, 2290 WebDOMMessageEvent msg_event(serialized_script_value,
2291 WebString::fromUTF16(params.source_origin), 2291 WebString::fromUTF16(params.source_origin),
2292 source_frame, 2292 source_frame,
2293 frame_->document(), 2293 frame_->document(),
2294 std::move(channels)); 2294 std::move(channels));
2295 frame_->dispatchMessageEventWithOriginCheck(target_origin, msg_event); 2295 frame_->dispatchMessageEventWithOriginCheck(target_origin, msg_event);
2296 } 2296 }
2297 2297
2298 void RenderFrameImpl::OnReload(bool bypass_cache) { 2298 void RenderFrameImpl::OnReload(bool bypass_cache) {
2299 frame_->reload(bypass_cache ? WebFrameLoadType::ReloadBypassingCache 2299 frame_->reload(bypass_cache ? WebFrameLoadType::ReloadBypassingCache
2300 : WebFrameLoadType::ReloadMainResource); 2300 : WebFrameLoadType::Reload);
2301 } 2301 }
2302 2302
2303 void RenderFrameImpl::OnReloadLoFiImages() { 2303 void RenderFrameImpl::OnReloadLoFiImages() {
2304 previews_state_ = PREVIEWS_NO_TRANSFORM; 2304 previews_state_ = PREVIEWS_NO_TRANSFORM;
2305 GetWebFrame()->reloadLoFiImages(); 2305 GetWebFrame()->reloadLoFiImages();
2306 } 2306 }
2307 2307
2308 void RenderFrameImpl::OnTextSurroundingSelectionRequest(uint32_t max_length) { 2308 void RenderFrameImpl::OnTextSurroundingSelectionRequest(uint32_t max_length) {
2309 blink::WebSurroundingText surroundingText; 2309 blink::WebSurroundingText surroundingText;
2310 surroundingText.initializeFromCurrentSelection(frame_, max_length); 2310 surroundingText.initializeFromCurrentSelection(frame_, max_length);
(...skipping 4138 matching lines...) Expand 10 before | Expand all | Expand 10 after
6449 if (!data_url.is_valid() || !data_url.SchemeIs(url::kDataScheme)) { 6449 if (!data_url.is_valid() || !data_url.SchemeIs(url::kDataScheme)) {
6450 data_url = params.url; 6450 data_url = params.url;
6451 } 6451 }
6452 } 6452 }
6453 #endif 6453 #endif
6454 std::string mime_type, charset, data; 6454 std::string mime_type, charset, data;
6455 if (net::DataURL::Parse(data_url, &mime_type, &charset, &data)) { 6455 if (net::DataURL::Parse(data_url, &mime_type, &charset, &data)) {
6456 const GURL base_url = params.base_url_for_data_url.is_empty() ? 6456 const GURL base_url = params.base_url_for_data_url.is_empty() ?
6457 params.url : params.base_url_for_data_url; 6457 params.url : params.base_url_for_data_url;
6458 bool replace = load_type == WebFrameLoadType::ReloadBypassingCache || 6458 bool replace = load_type == WebFrameLoadType::ReloadBypassingCache ||
6459 load_type == WebFrameLoadType::ReloadMainResource ||
6460 load_type == WebFrameLoadType::Reload; 6459 load_type == WebFrameLoadType::Reload;
6461 6460
6462 frame->loadData( 6461 frame->loadData(
6463 WebData(data.c_str(), data.length()), WebString::fromUTF8(mime_type), 6462 WebData(data.c_str(), data.length()), WebString::fromUTF8(mime_type),
6464 WebString::fromUTF8(charset), base_url, 6463 WebString::fromUTF8(charset), base_url,
6465 // Needed so that history-url-only changes don't become reloads. 6464 // Needed so that history-url-only changes don't become reloads.
6466 params.history_url_for_data_url, replace, load_type, 6465 params.history_url_for_data_url, replace, load_type,
6467 item_for_history_navigation, history_load_type, is_client_redirect); 6466 item_for_history_navigation, history_load_type, is_client_redirect);
6468 } else { 6467 } else {
6469 CHECK(false) << "Invalid URL passed: " 6468 CHECK(false) << "Invalid URL passed: "
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
6979 policy(info.defaultPolicy), 6978 policy(info.defaultPolicy),
6980 replaces_current_history_item(info.replacesCurrentHistoryItem), 6979 replaces_current_history_item(info.replacesCurrentHistoryItem),
6981 history_navigation_in_new_child_frame( 6980 history_navigation_in_new_child_frame(
6982 info.isHistoryNavigationInNewChildFrame), 6981 info.isHistoryNavigationInNewChildFrame),
6983 client_redirect(info.isClientRedirect), 6982 client_redirect(info.isClientRedirect),
6984 cache_disabled(info.isCacheDisabled), 6983 cache_disabled(info.isCacheDisabled),
6985 form(info.form), 6984 form(info.form),
6986 source_location(info.sourceLocation) {} 6985 source_location(info.sourceLocation) {}
6987 6986
6988 } // namespace content 6987 } // namespace content
OLDNEW
« no previous file with comments | « chrome/renderer/net/net_error_helper.cc ('k') | third_party/WebKit/Source/core/frame/History.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698