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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 2022413002: Convert startup_metric_utils to use mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@message-mojom-magic
Patch Set: Created 4 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 #include "components/dom_distiller/content/renderer/distillability_agent.h" 68 #include "components/dom_distiller/content/renderer/distillability_agent.h"
69 #include "components/dom_distiller/content/renderer/distiller_js_render_frame_ob server.h" 69 #include "components/dom_distiller/content/renderer/distiller_js_render_frame_ob server.h"
70 #include "components/dom_distiller/core/url_constants.h" 70 #include "components/dom_distiller/core/url_constants.h"
71 #include "components/error_page/common/localized_error.h" 71 #include "components/error_page/common/localized_error.h"
72 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" 72 #include "components/network_hints/renderer/prescient_networking_dispatcher.h"
73 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" 73 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h"
74 #include "components/password_manager/content/renderer/credential_manager_client .h" 74 #include "components/password_manager/content/renderer/credential_manager_client .h"
75 #include "components/pdf/renderer/pepper_pdf_host.h" 75 #include "components/pdf/renderer/pepper_pdf_host.h"
76 #include "components/plugins/renderer/mobile_youtube_plugin.h" 76 #include "components/plugins/renderer/mobile_youtube_plugin.h"
77 #include "components/signin/core/common/profile_management_switches.h" 77 #include "components/signin/core/common/profile_management_switches.h"
78 #include "components/startup_metric_utils/common/startup_metric_messages.h" 78 #include "components/startup_metric_utils/common/startup_metric.mojom.h"
79 #include "components/version_info/version_info.h" 79 #include "components/version_info/version_info.h"
80 #include "components/visitedlink/renderer/visitedlink_slave.h" 80 #include "components/visitedlink/renderer/visitedlink_slave.h"
81 #include "components/web_cache/renderer/web_cache_impl.h" 81 #include "components/web_cache/renderer/web_cache_impl.h"
82 #include "content/public/common/content_constants.h" 82 #include "content/public/common/content_constants.h"
83 #include "content/public/common/content_switches.h" 83 #include "content/public/common/content_switches.h"
84 #include "content/public/common/service_registry.h"
84 #include "content/public/common/url_constants.h" 85 #include "content/public/common/url_constants.h"
85 #include "content/public/renderer/plugin_instance_throttler.h" 86 #include "content/public/renderer/plugin_instance_throttler.h"
86 #include "content/public/renderer/render_frame.h" 87 #include "content/public/renderer/render_frame.h"
87 #include "content/public/renderer/render_thread.h" 88 #include "content/public/renderer/render_thread.h"
88 #include "content/public/renderer/render_view.h" 89 #include "content/public/renderer/render_view.h"
89 #include "content/public/renderer/render_view_visitor.h" 90 #include "content/public/renderer/render_view_visitor.h"
90 #include "extensions/common/constants.h" 91 #include "extensions/common/constants.h"
91 #include "ipc/ipc_sync_channel.h" 92 #include "ipc/ipc_sync_channel.h"
92 #include "net/base/net_errors.h" 93 #include "net/base/net_errors.h"
93 #include "ppapi/c/private/ppb_pdf.h" 94 #include "ppapi/c/private/ppb_pdf.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 printing::SetAgent(GetUserAgent()); 323 printing::SetAgent(GetUserAgent());
323 #endif 324 #endif
324 } 325 }
325 326
326 ChromeContentRendererClient::~ChromeContentRendererClient() { 327 ChromeContentRendererClient::~ChromeContentRendererClient() {
327 } 328 }
328 329
329 void ChromeContentRendererClient::RenderThreadStarted() { 330 void ChromeContentRendererClient::RenderThreadStarted() {
330 RenderThread* thread = RenderThread::Get(); 331 RenderThread* thread = RenderThread::Get();
331 332
332 thread->Send(new StartupMetricHostMsg_RecordRendererMainEntryTime( 333 {
333 main_entry_time_)); 334 startup_metric_utils::mojom::StartupMetricHostPtr startup_metric_host;
335 thread->GetServiceRegistry()->ConnectToRemoteService(
336 mojo::GetProxy(&startup_metric_host));
337 startup_metric_host->RecordRendererMainEntryTime(main_entry_time_);
338 }
334 339
335 chrome_observer_.reset(new ChromeRenderThreadObserver()); 340 chrome_observer_.reset(new ChromeRenderThreadObserver());
336 web_cache_impl_.reset(new web_cache::WebCacheImpl()); 341 web_cache_impl_.reset(new web_cache::WebCacheImpl());
337 342
338 #if defined(ENABLE_EXTENSIONS) 343 #if defined(ENABLE_EXTENSIONS)
339 ChromeExtensionsRendererClient::GetInstance()->RenderThreadStarted(); 344 ChromeExtensionsRendererClient::GetInstance()->RenderThreadStarted();
340 #endif 345 #endif
341 346
342 prescient_networking_dispatcher_.reset( 347 prescient_networking_dispatcher_.reset(
343 new network_hints::PrescientNetworkingDispatcher()); 348 new network_hints::PrescientNetworkingDispatcher());
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 // chrome.system.network.getNetworkInterfaces provides the same 1389 // chrome.system.network.getNetworkInterfaces provides the same
1385 // information. Also, the enforcement of sending and binding UDP is already done 1390 // information. Also, the enforcement of sending and binding UDP is already done
1386 // by chrome extension permission model. 1391 // by chrome extension permission model.
1387 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { 1392 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() {
1388 #if defined(ENABLE_EXTENSIONS) 1393 #if defined(ENABLE_EXTENSIONS)
1389 return !IsStandaloneExtensionProcess(); 1394 return !IsStandaloneExtensionProcess();
1390 #else 1395 #else
1391 return true; 1396 return true;
1392 #endif 1397 #endif
1393 } 1398 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698