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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2687583002: Add support for single sample metrics. (Closed)
Patch Set: Add tests. 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "base/sys_info.h" 46 #include "base/sys_info.h"
47 #include "base/threading/thread.h" 47 #include "base/threading/thread.h"
48 #include "base/threading/thread_restrictions.h" 48 #include "base/threading/thread_restrictions.h"
49 #include "base/threading/thread_task_runner_handle.h" 49 #include "base/threading/thread_task_runner_handle.h"
50 #include "base/trace_event/trace_event.h" 50 #include "base/trace_event/trace_event.h"
51 #include "base/tracked_objects.h" 51 #include "base/tracked_objects.h"
52 #include "build/build_config.h" 52 #include "build/build_config.h"
53 #include "cc/base/switches.h" 53 #include "cc/base/switches.h"
54 #include "cc/output/buffer_to_texture_target_map.h" 54 #include "cc/output/buffer_to_texture_target_map.h"
55 #include "components/discardable_memory/service/discardable_shared_memory_manage r.h" 55 #include "components/discardable_memory/service/discardable_shared_memory_manage r.h"
56 #include "components/metrics/single_sample_metrics_provider.h"
56 #include "components/tracing/common/tracing_switches.h" 57 #include "components/tracing/common/tracing_switches.h"
57 #include "content/browser/appcache/appcache_dispatcher_host.h" 58 #include "content/browser/appcache/appcache_dispatcher_host.h"
58 #include "content/browser/appcache/chrome_appcache_service.h" 59 #include "content/browser/appcache/chrome_appcache_service.h"
59 #include "content/browser/background_fetch/background_fetch_service_impl.h" 60 #include "content/browser/background_fetch/background_fetch_service_impl.h"
60 #include "content/browser/background_sync/background_sync_service_impl.h" 61 #include "content/browser/background_sync/background_sync_service_impl.h"
61 #include "content/browser/bad_message.h" 62 #include "content/browser/bad_message.h"
62 #include "content/browser/blob_storage/blob_dispatcher_host.h" 63 #include "content/browser/blob_storage/blob_dispatcher_host.h"
63 #include "content/browser/blob_storage/chrome_blob_storage_context.h" 64 #include "content/browser/blob_storage/chrome_blob_storage_context.h"
64 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" 65 #include "content/browser/broadcast_channel/broadcast_channel_provider.h"
65 #include "content/browser/browser_child_process_host_impl.h" 66 #include "content/browser/browser_child_process_host_impl.h"
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 make_scoped_refptr( 1319 make_scoped_refptr(
1319 storage_partition_impl_->GetBackgroundFetchContext()))); 1320 storage_partition_impl_->GetBackgroundFetchContext())));
1320 1321
1321 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest, 1322 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest,
1322 base::Unretained(this))); 1323 base::Unretained(this)));
1323 1324
1324 registry->AddInterface( 1325 registry->AddInterface(
1325 base::Bind(&VideoCaptureHost::Create, 1326 base::Bind(&VideoCaptureHost::Create,
1326 BrowserMainLoop::GetInstance()->media_stream_manager())); 1327 BrowserMainLoop::GetInstance()->media_stream_manager()));
1327 1328
1329 registry->AddInterface(
1330 base::Bind(&metrics::SingleSampleMetricsProvider::Create));
1331
1328 if (base::FeatureList::IsEnabled(features::kOffMainThreadFetch)) { 1332 if (base::FeatureList::IsEnabled(features::kOffMainThreadFetch)) {
1329 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context( 1333 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context(
1330 static_cast<ServiceWorkerContextWrapper*>( 1334 static_cast<ServiceWorkerContextWrapper*>(
1331 storage_partition_impl_->GetServiceWorkerContext())); 1335 storage_partition_impl_->GetServiceWorkerContext()));
1332 registry->AddInterface( 1336 registry->AddInterface(
1333 base::Bind(&WorkerURLLoaderFactoryProviderImpl::Create, GetID(), 1337 base::Bind(&WorkerURLLoaderFactoryProviderImpl::Create, GetID(),
1334 resource_message_filter_, service_worker_context)); 1338 resource_message_filter_, service_worker_context));
1335 } 1339 }
1336 1340
1337 // This is to support usage of WebSockets in cases in which there is no 1341 // This is to support usage of WebSockets in cases in which there is no
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after
3132 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3136 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3133 3137
3134 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3138 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3135 // Capture the error message in a crash key value. 3139 // Capture the error message in a crash key value.
3136 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3140 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3137 bad_message::ReceivedBadMessage(render_process_id, 3141 bad_message::ReceivedBadMessage(render_process_id,
3138 bad_message::RPH_MOJO_PROCESS_ERROR); 3142 bad_message::RPH_MOJO_PROCESS_ERROR);
3139 } 3143 }
3140 3144
3141 } // namespace content 3145 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698