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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2687583002: Add support for single sample metrics. (Closed)
Patch Set: Use thread local storage. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 7a77da1d6d5ea74edee558d5afb9a60958644a90..0e23262f77232612f391730667dab65b36187d2f 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -51,6 +51,8 @@
#include "cc/trees/layer_tree_host_common.h"
#include "cc/trees/layer_tree_settings.h"
#include "components/discardable_memory/client/client_discardable_shared_memory_manager.h"
+#include "components/metrics/public/interfaces/single_value_histograms.mojom.h"
+#include "components/metrics/single_value_histograms_factory_impl.h"
#include "content/child/appcache/appcache_dispatcher.h"
#include "content/child/appcache/appcache_frontend_impl.h"
#include "content/child/blob_storage/blob_message_filter.h"
@@ -611,6 +613,13 @@ void RenderThreadImpl::Init(
// Register this object as the main thread.
ChildProcess::current()->set_main_thread(this);
+ // In single process mode we may already have a factory set.
+ if (!base::SingleValueHistogramsFactory::Get()) {
+ base::SingleValueHistogramsFactory::SetFactory(
+ new metrics::SingleValueHistogramsFactoryImpl(
+ GetConnector(), base::ThreadTaskRunnerHandle::Get()));
+ }
+
gpu_ = ui::Gpu::Create(
GetConnector(),
IsRunningInMash() ? ui::mojom::kServiceName : mojom::kBrowserServiceName,

Powered by Google App Engine
This is Rietveld 408576698