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

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

Issue 2901093006: Use has_committed_real_load for main frames in addition to subframes. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5254 matching lines...) Expand 10 before | Expand all | Expand 10 after
5265 bool has_stale_copy_in_cache, 5265 bool has_stale_copy_in_cache,
5266 int error_code) { 5266 int error_code) {
5267 DCHECK(IsBrowserSideNavigationEnabled()); 5267 DCHECK(IsBrowserSideNavigationEnabled());
5268 bool is_reload = 5268 bool is_reload =
5269 FrameMsg_Navigate_Type::IsReload(common_params.navigation_type); 5269 FrameMsg_Navigate_Type::IsReload(common_params.navigation_type);
5270 RenderFrameImpl::PrepareRenderViewForNavigation( 5270 RenderFrameImpl::PrepareRenderViewForNavigation(
5271 common_params.url, request_params); 5271 common_params.url, request_params);
5272 5272
5273 GetContentClient()->SetActiveURL(common_params.url); 5273 GetContentClient()->SetActiveURL(common_params.url);
5274 5274
5275 // If this frame isn't in the same process as the main frame, it may naively 5275 // If this frame is navigating cross-process, it may naively assume that this
5276 // assume that this is the first navigation in the iframe, but this may not 5276 // is the first navigation in the frame, but this may not actually be the
5277 // actually be the case. Inform the frame's state machine if this frame has 5277 // case. Inform the frame's state machine if this frame has already committed
5278 // already committed other loads. 5278 // other loads.
5279 if (request_params.has_committed_real_load && frame_->Parent()) 5279 if (request_params.has_committed_real_load)
5280 frame_->SetCommittedFirstRealLoad(); 5280 frame_->SetCommittedFirstRealLoad();
5281 5281
5282 pending_navigation_params_.reset(new NavigationParams( 5282 pending_navigation_params_.reset(new NavigationParams(
5283 common_params, StartNavigationParams(), request_params)); 5283 common_params, StartNavigationParams(), request_params));
5284 5284
5285 // Send the provisional load failure. 5285 // Send the provisional load failure.
5286 blink::WebURLError error = 5286 blink::WebURLError error =
5287 CreateWebURLError(common_params.url, has_stale_copy_in_cache, error_code); 5287 CreateWebURLError(common_params.url, has_stale_copy_in_cache, error_code);
5288 WebURLRequest failed_request = 5288 WebURLRequest failed_request =
5289 CreateURLRequestForNavigation(common_params, request_params, 5289 CreateURLRequestForNavigation(common_params, request_params,
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
6022 base::TimeTicks renderer_navigation_start = base::TimeTicks::Now(); 6022 base::TimeTicks renderer_navigation_start = base::TimeTicks::Now();
6023 bool is_reload = 6023 bool is_reload =
6024 FrameMsg_Navigate_Type::IsReload(common_params.navigation_type); 6024 FrameMsg_Navigate_Type::IsReload(common_params.navigation_type);
6025 bool is_history_navigation = request_params.page_state.IsValid(); 6025 bool is_history_navigation = request_params.page_state.IsValid();
6026 WebCachePolicy cache_policy = WebCachePolicy::kUseProtocolCachePolicy; 6026 WebCachePolicy cache_policy = WebCachePolicy::kUseProtocolCachePolicy;
6027 RenderFrameImpl::PrepareRenderViewForNavigation( 6027 RenderFrameImpl::PrepareRenderViewForNavigation(
6028 common_params.url, request_params); 6028 common_params.url, request_params);
6029 6029
6030 GetContentClient()->SetActiveURL(common_params.url); 6030 GetContentClient()->SetActiveURL(common_params.url);
6031 6031
6032 // If this frame isn't in the same process as the main frame, it may naively 6032 // If this frame is navigating cross-process, it may naively assume that this
6033 // assume that this is the first navigation in the iframe, but this may not 6033 // is the first navigation in the frame, but this may not actually be the
6034 // actually be the case. Inform the frame's state machine if this frame has 6034 // case. Inform the frame's state machine if this frame has already committed
6035 // already committed other loads. 6035 // other loads.
6036 if (request_params.has_committed_real_load && frame_->Parent()) 6036 if (request_params.has_committed_real_load)
6037 frame_->SetCommittedFirstRealLoad(); 6037 frame_->SetCommittedFirstRealLoad();
6038 6038
6039 if (is_reload && current_history_item_.IsNull()) { 6039 if (is_reload && current_history_item_.IsNull()) {
6040 // We cannot reload if we do not have any history state. This happens, for 6040 // We cannot reload if we do not have any history state. This happens, for
6041 // example, when recovering from a crash. 6041 // example, when recovering from a crash.
6042 is_reload = false; 6042 is_reload = false;
6043 cache_policy = WebCachePolicy::kValidatingCacheData; 6043 cache_policy = WebCachePolicy::kValidatingCacheData;
6044 } 6044 }
6045 6045
6046 // If the navigation is for "view source", the WebLocalFrame needs to be put 6046 // If the navigation is for "view source", the WebLocalFrame needs to be put
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
7063 policy(info.default_policy), 7063 policy(info.default_policy),
7064 replaces_current_history_item(info.replaces_current_history_item), 7064 replaces_current_history_item(info.replaces_current_history_item),
7065 history_navigation_in_new_child_frame( 7065 history_navigation_in_new_child_frame(
7066 info.is_history_navigation_in_new_child_frame), 7066 info.is_history_navigation_in_new_child_frame),
7067 client_redirect(info.is_client_redirect), 7067 client_redirect(info.is_client_redirect),
7068 cache_disabled(info.is_cache_disabled), 7068 cache_disabled(info.is_cache_disabled),
7069 form(info.form), 7069 form(info.form),
7070 source_location(info.source_location) {} 7070 source_location(info.source_location) {}
7071 7071
7072 } // namespace content 7072 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698