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

Unified Diff: components/html_viewer/stats_collection_observer.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: components/html_viewer/stats_collection_observer.cc
diff --git a/content/renderer/stats_collection_observer.cc b/components/html_viewer/stats_collection_observer.cc
similarity index 56%
copy from content/renderer/stats_collection_observer.cc
copy to components/html_viewer/stats_collection_observer.cc
index 4c4b911ec8cbedb9cdf0858ec590b48701c0f73a..2efb5f4ca60b4b8d6d547dc0c8998780f6148699 100644
--- a/content/renderer/stats_collection_observer.cc
+++ b/components/html_viewer/stats_collection_observer.cc
@@ -2,15 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/renderer/stats_collection_observer.h"
+#include "components/html_viewer/stats_collection_observer.h"
-#include "base/time/time.h"
-#include "content/renderer/render_view_impl.h"
+namespace html_viewer {
-namespace content {
-
-StatsCollectionObserver::StatsCollectionObserver(RenderViewImpl* render_view)
- : RenderViewObserver(render_view) {
+StatsCollectionObserver::StatsCollectionObserver(HTMLDocument* html_document)
+ : HTMLDocument::Observer(html_document) {
}
StatsCollectionObserver::~StatsCollectionObserver() {
@@ -26,8 +23,7 @@ void StatsCollectionObserver::DidStopLoading() {
stop_time_ = base::Time::Now();
// Stop observing so we don't get called again.
- RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view());
- impl->RemoveObserver(this);
+ html_document()->RemoveObserver(this);
}
-} // namespace content
+} // namespace html_viewer

Powered by Google App Engine
This is Rietveld 408576698