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

Unified Diff: mojo/runner/context.cc

Issue 1278673002: Add stats collection for telemetry startup.warm.blank_page test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cache and reuse a single mojo:tracing connection in mojo:html_viewer. Created 5 years, 4 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: mojo/runner/context.cc
diff --git a/mojo/runner/context.cc b/mojo/runner/context.cc
index 39d0536973c48d12b19486658aa6ba6f5844bf9e..ef3bf2dfd256dd3a483517d939c548fa57a1ba33 100644
--- a/mojo/runner/context.cc
+++ b/mojo/runner/context.cc
@@ -14,6 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/path_service.h"
+#include "base/process/process_info.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
@@ -313,6 +314,15 @@ bool Context::Init() {
tracing_service_provider_ptr.Pass(),
shell::GetPermissiveCapabilityFilter(), base::Closure());
+ // Record the shell process creation time for performance testing.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kStatsCollectionController)) {
+ tracing::StartupPerformanceControllerPtr controller;
+ application_manager_.ConnectToService(GURL("mojo:tracing"), &controller);
yzshen1 2015/08/13 15:59:12 Please consider directly obtaining a service provi
msw 2015/08/14 23:20:35 Done.
+ const base::Time creation_time = base::CurrentProcessInfo::CreationTime();
+ controller->SetShellProcessCreationTime(creation_time.ToInternalValue());
+ }
+
InitDevToolsServiceIfNeeded(&application_manager_, command_line);
return true;

Powered by Google App Engine
This is Rietveld 408576698