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

Unified Diff: components/html_viewer/stats_collection_controller.h

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: components/html_viewer/stats_collection_controller.h
diff --git a/content/renderer/stats_collection_controller.h b/components/html_viewer/stats_collection_controller.h
similarity index 51%
copy from content/renderer/stats_collection_controller.h
copy to components/html_viewer/stats_collection_controller.h
index c36349c51a2dfdaf43297c3838ac7fac5dc5abf9..9e314c750fd8607e149d0ad9c3d12fc46d05a531 100644
--- a/content/renderer/stats_collection_controller.h
+++ b/components/html_viewer/stats_collection_controller.h
@@ -1,18 +1,24 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_RENDERER_STATS_COLLECTION_CONTROLLER_H_
-#define CONTENT_RENDERER_STATS_COLLECTION_CONTROLLER_H_
+#ifndef COMPONENTS_HTML_VIEWER_STATS_COLLECTION_CONTROLLER_H_
+#define COMPONENTS_HTML_VIEWER_STATS_COLLECTION_CONTROLLER_H_
#include "base/basictypes.h"
+#include "components/html_viewer/stats_collection_observer.h"
#include "gin/wrappable.h"
+#include "mojo/services/tracing/tracing.mojom.h"
namespace blink {
class WebFrame;
}
-namespace content {
+namespace mojo {
+class ApplicationImpl;
+}
+
+namespace html_viewer {
// This class is exposed in JS as window.statsCollectionController and provides
// functionality to read out statistics from the browser.
@@ -23,10 +29,16 @@ class StatsCollectionController
public:
static gin::WrapperInfo kWrapperInfo;
- static void Install(blink::WebFrame* frame);
+ static StatsCollectionController* Install(HTMLDocument* html_document,
sky 2015/08/12 23:54:36 Can you make this take WebFrame, which would work
yzshen1 2015/08/13 15:59:12 Please comment about the lifespan and ownership of
msw 2015/08/14 23:20:35 Done.
msw 2015/08/14 23:20:35 Done.
+ mojo::ApplicationImpl* app);
+
+ // Record timing for various blink::WebFrameClient events.
+ void DidHandleOnloadEvents(const base::Time& time);
+ void DidFirstVisuallyNonEmptyLayout(const base::Time& time);
private:
- StatsCollectionController();
+ StatsCollectionController(HTMLDocument* html_document,
+ mojo::ApplicationImpl* app);
~StatsCollectionController() override;
// gin::WrappableBase
@@ -36,16 +48,18 @@ class StatsCollectionController
// Retrieves a histogram and returns a JSON representation of it.
std::string GetHistogram(const std::string& histogram_name);
- // Retrieves a histogram from the browser process and returns a JSON
- // representation of it.
+ // Retrieves a browser histogram and returns a JSON representation of it.
std::string GetBrowserHistogram(const std::string& histogram_name);
// Returns JSON representation of tab timing information for the current tab.
std::string GetTabLoadTiming();
+ StatsCollectionObserver observer_;
yzshen1 2015/08/13 15:59:12 Maybe consider merging the observer into this clas
msw 2015/08/14 23:20:34 Removed.
+ tracing::StartupPerformanceControllerPtr startup_performance_controller_;
+
DISALLOW_COPY_AND_ASSIGN(StatsCollectionController);
};
-} // namespace content
+} // namespace html_viewer
-#endif // CONTENT_RENDERER_STATS_COLLECTION_CONTROLLER_H_
+#endif // COMPONENTS_HTML_VIEWER_STATS_COLLECTION_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698