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

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

Issue 1368643002: Add a signal to the scheduler that a navigation is expected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename for Sami Created 5 years, 2 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 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 return handled; 1139 return handled;
1140 } 1140 }
1141 1141
1142 void RenderFrameImpl::OnNavigate( 1142 void RenderFrameImpl::OnNavigate(
1143 const CommonNavigationParams& common_params, 1143 const CommonNavigationParams& common_params,
1144 const StartNavigationParams& start_params, 1144 const StartNavigationParams& start_params,
1145 const RequestNavigationParams& request_params) { 1145 const RequestNavigationParams& request_params) {
1146 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); 1146 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current();
1147 // Can be NULL in tests. 1147 // Can be NULL in tests.
1148 if (render_thread_impl) 1148 if (render_thread_impl)
1149 render_thread_impl->GetRendererScheduler()->OnPageLoadStarted(); 1149 render_thread_impl->GetRendererScheduler()->OnNavigationStarted();
1150 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch( 1150 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(
1151 switches::kEnableBrowserSideNavigation)); 1151 switches::kEnableBrowserSideNavigation));
1152 TRACE_EVENT2("navigation", "RenderFrameImpl::OnNavigate", "id", routing_id_, 1152 TRACE_EVENT2("navigation", "RenderFrameImpl::OnNavigate", "id", routing_id_,
1153 "url", common_params.url.possibly_invalid_spec()); 1153 "url", common_params.url.possibly_invalid_spec());
1154 NavigateInternal(common_params, start_params, request_params, 1154 NavigateInternal(common_params, start_params, request_params,
1155 scoped_ptr<StreamOverrideParameters>()); 1155 scoped_ptr<StreamOverrideParameters>());
1156 } 1156 }
1157 1157
1158 void RenderFrameImpl::NavigateToSwappedOutURL() { 1158 void RenderFrameImpl::NavigateToSwappedOutURL() {
1159 // We use loadRequest instead of loadHTMLString because the former commits 1159 // We use loadRequest instead of loadHTMLString because the former commits
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
2800 RenderFrameObserver, observers_, 2800 RenderFrameObserver, observers_,
2801 DidCommitProvisionalLoad(is_new_navigation, 2801 DidCommitProvisionalLoad(is_new_navigation,
2802 navigation_state->WasWithinSamePage())); 2802 navigation_state->WasWithinSamePage()));
2803 2803
2804 if (!frame->parent()) { // Only for top frames. 2804 if (!frame->parent()) { // Only for top frames.
2805 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); 2805 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current();
2806 if (render_thread_impl) { // Can be NULL in tests. 2806 if (render_thread_impl) { // Can be NULL in tests.
2807 render_thread_impl->histogram_customizer()-> 2807 render_thread_impl->histogram_customizer()->
2808 RenderViewNavigatedToHost(GURL(GetLoadingUrl()).host(), 2808 RenderViewNavigatedToHost(GURL(GetLoadingUrl()).host(),
2809 RenderView::GetRenderViewCount()); 2809 RenderView::GetRenderViewCount());
2810 render_thread_impl->GetRendererScheduler()->OnPageLoadStarted(); 2810 render_thread_impl->GetRendererScheduler()->OnNavigationStarted();
2811 } 2811 }
2812 } 2812 }
2813 2813
2814 // Remember that we've already processed this request, so we don't update 2814 // Remember that we've already processed this request, so we don't update
2815 // the session history again. We do this regardless of whether this is 2815 // the session history again. We do this regardless of whether this is
2816 // a session history navigation, because if we attempted a session history 2816 // a session history navigation, because if we attempted a session history
2817 // navigation without valid HistoryItem state, WebCore will think it is a 2817 // navigation without valid HistoryItem state, WebCore will think it is a
2818 // new navigation. 2818 // new navigation.
2819 navigation_state->set_request_committed(true); 2819 navigation_state->set_request_committed(true);
2820 2820
(...skipping 2317 matching lines...) Expand 10 before | Expand all | Expand 10 after
5138 mojo::ServiceProviderPtr service_provider; 5138 mojo::ServiceProviderPtr service_provider;
5139 mojo::URLRequestPtr request(mojo::URLRequest::New()); 5139 mojo::URLRequestPtr request(mojo::URLRequest::New());
5140 request->url = mojo::String::From(url); 5140 request->url = mojo::String::From(url);
5141 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), 5141 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider),
5142 nullptr, nullptr, 5142 nullptr, nullptr,
5143 base::Bind(&OnGotContentHandlerID)); 5143 base::Bind(&OnGotContentHandlerID));
5144 return service_provider.Pass(); 5144 return service_provider.Pass();
5145 } 5145 }
5146 5146
5147 } // namespace content 5147 } // namespace content
OLDNEW
« no previous file with comments | « components/scheduler/renderer/renderer_web_scheduler_impl.cc ('k') | content/test/fake_renderer_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698