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

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

Issue 1320633002: Optimize for TouchStart responsiveness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try set OnPageLoadStarted in RenderFrameImpl::OnNavigate Created 5 years, 3 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 | « components/scheduler/scheduler.gypi ('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 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/debug/alias.h" 12 #include "base/debug/alias.h"
13 #include "base/debug/asan_invalid_access.h" 13 #include "base/debug/asan_invalid_access.h"
14 #include "base/debug/dump_without_crashing.h" 14 #include "base/debug/dump_without_crashing.h"
15 #include "base/i18n/char_iterator.h" 15 #include "base/i18n/char_iterator.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/process/process.h" 17 #include "base/process/process.h"
18 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
19 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
20 #include "base/thread_task_runner_handle.h" 20 #include "base/thread_task_runner_handle.h"
21 #include "base/time/time.h" 21 #include "base/time/time.h"
22 #include "cc/base/switches.h" 22 #include "cc/base/switches.h"
23 #include "components/scheduler/renderer/renderer_scheduler.h"
23 #include "content/child/appcache/appcache_dispatcher.h" 24 #include "content/child/appcache/appcache_dispatcher.h"
24 #include "content/child/permissions/permission_dispatcher.h" 25 #include "content/child/permissions/permission_dispatcher.h"
25 #include "content/child/plugin_messages.h" 26 #include "content/child/plugin_messages.h"
26 #include "content/child/quota_dispatcher.h" 27 #include "content/child/quota_dispatcher.h"
27 #include "content/child/request_extra_data.h" 28 #include "content/child/request_extra_data.h"
28 #include "content/child/service_worker/service_worker_handle_reference.h" 29 #include "content/child/service_worker/service_worker_handle_reference.h"
29 #include "content/child/service_worker/service_worker_network_provider.h" 30 #include "content/child/service_worker/service_worker_network_provider.h"
30 #include "content/child/service_worker/service_worker_provider_context.h" 31 #include "content/child/service_worker/service_worker_provider_context.h"
31 #include "content/child/service_worker/web_service_worker_provider_impl.h" 32 #include "content/child/service_worker/web_service_worker_provider_impl.h"
32 #include "content/child/v8_value_converter_impl.h" 33 #include "content/child/v8_value_converter_impl.h"
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 #endif 1138 #endif
1138 IPC_END_MESSAGE_MAP() 1139 IPC_END_MESSAGE_MAP()
1139 1140
1140 return handled; 1141 return handled;
1141 } 1142 }
1142 1143
1143 void RenderFrameImpl::OnNavigate( 1144 void RenderFrameImpl::OnNavigate(
1144 const CommonNavigationParams& common_params, 1145 const CommonNavigationParams& common_params,
1145 const StartNavigationParams& start_params, 1146 const StartNavigationParams& start_params,
1146 const RequestNavigationParams& request_params) { 1147 const RequestNavigationParams& request_params) {
1148 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current();
1149 // Can be NULL in tests.
1150 if (render_thread_impl)
1151 render_thread_impl->GetRendererScheduler()->OnPageLoadStarted();
1147 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch( 1152 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(
1148 switches::kEnableBrowserSideNavigation)); 1153 switches::kEnableBrowserSideNavigation));
1149 TRACE_EVENT2("navigation", "RenderFrameImpl::OnNavigate", "id", routing_id_, 1154 TRACE_EVENT2("navigation", "RenderFrameImpl::OnNavigate", "id", routing_id_,
1150 "url", common_params.url.possibly_invalid_spec()); 1155 "url", common_params.url.possibly_invalid_spec());
1151 NavigateInternal(common_params, start_params, request_params, 1156 NavigateInternal(common_params, start_params, request_params,
1152 scoped_ptr<StreamOverrideParameters>()); 1157 scoped_ptr<StreamOverrideParameters>());
1153 } 1158 }
1154 1159
1155 void RenderFrameImpl::NavigateToSwappedOutURL() { 1160 void RenderFrameImpl::NavigateToSwappedOutURL() {
1156 // We use loadRequest instead of loadHTMLString because the former commits 1161 // We use loadRequest instead of loadHTMLString because the former commits
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after
2788 RenderFrameObserver, observers_, 2793 RenderFrameObserver, observers_,
2789 DidCommitProvisionalLoad(is_new_navigation, 2794 DidCommitProvisionalLoad(is_new_navigation,
2790 navigation_state->WasWithinSamePage())); 2795 navigation_state->WasWithinSamePage()));
2791 2796
2792 if (!frame->parent()) { // Only for top frames. 2797 if (!frame->parent()) { // Only for top frames.
2793 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); 2798 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current();
2794 if (render_thread_impl) { // Can be NULL in tests. 2799 if (render_thread_impl) { // Can be NULL in tests.
2795 render_thread_impl->histogram_customizer()-> 2800 render_thread_impl->histogram_customizer()->
2796 RenderViewNavigatedToHost(GURL(GetLoadingUrl()).host(), 2801 RenderViewNavigatedToHost(GURL(GetLoadingUrl()).host(),
2797 RenderView::GetRenderViewCount()); 2802 RenderView::GetRenderViewCount());
2803 render_thread_impl->GetRendererScheduler()->OnPageLoadStarted();
2798 } 2804 }
2799 } 2805 }
2800 2806
2801 // Remember that we've already processed this request, so we don't update 2807 // Remember that we've already processed this request, so we don't update
2802 // the session history again. We do this regardless of whether this is 2808 // the session history again. We do this regardless of whether this is
2803 // a session history navigation, because if we attempted a session history 2809 // a session history navigation, because if we attempted a session history
2804 // navigation without valid HistoryItem state, WebCore will think it is a 2810 // navigation without valid HistoryItem state, WebCore will think it is a
2805 // new navigation. 2811 // new navigation.
2806 navigation_state->set_request_committed(true); 2812 navigation_state->set_request_committed(true);
2807 2813
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after
5100 mojo::ServiceProviderPtr service_provider; 5106 mojo::ServiceProviderPtr service_provider;
5101 mojo::URLRequestPtr request(mojo::URLRequest::New()); 5107 mojo::URLRequestPtr request(mojo::URLRequest::New());
5102 request->url = mojo::String::From(url); 5108 request->url = mojo::String::From(url);
5103 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), 5109 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider),
5104 nullptr, nullptr, 5110 nullptr, nullptr,
5105 base::Bind(&OnGotContentHandlerID)); 5111 base::Bind(&OnGotContentHandlerID));
5106 return service_provider.Pass(); 5112 return service_provider.Pass();
5107 } 5113 }
5108 5114
5109 } // namespace content 5115 } // namespace content
OLDNEW
« no previous file with comments | « components/scheduler/scheduler.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698