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

Unified Diff: components/html_viewer/html_document.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/html_document.h
diff --git a/components/html_viewer/html_document.h b/components/html_viewer/html_document.h
index 926e503cfcbdad67da868f85cb1c7d4ff084e2a3..ce5825454a7098f63a295d81a0eb556831bb917e 100644
--- a/components/html_viewer/html_document.h
+++ b/components/html_viewer/html_document.h
@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "base/observer_list.h"
#include "components/html_viewer/ax_provider_impl.h"
#include "components/html_viewer/touch_handler.h"
#include "components/view_manager/public/cpp/view_manager_client_factory.h"
@@ -41,6 +42,7 @@ class AxProviderImpl;
class DevToolsAgentImpl;
class GeolocationClientImpl;
class GlobalState;
+class StatsCollectionController;
class WebLayerTreeViewImpl;
// A view for a single HTML document.
@@ -71,6 +73,18 @@ class HTMLDocument : public blink::WebViewClient,
DeleteCallback delete_callback;
};
+ class Observer {
sky 2015/08/12 23:54:36 I'm hoping to nuke HTMLDocument soon. Can you move
msw 2015/08/14 23:20:34 Nothing actually uses StatsCollectionController::G
+ public:
+ explicit Observer(HTMLDocument* html_document);
+ virtual ~Observer();
+ virtual void DidStartLoading() {}
+ virtual void DidStopLoading() {}
+ HTMLDocument* html_document() const { return html_document_; }
+ private:
+ HTMLDocument* html_document_;
+ DISALLOW_COPY_AND_ASSIGN(Observer);
+ };
+
// Load a new HTMLDocument with |response|.
// |html_document_app| is the application this app was created in, and
// |connection| the specific connection triggering this new instance.
@@ -80,6 +94,9 @@ class HTMLDocument : public blink::WebViewClient,
// Deletes this object.
void Destroy();
+ void AddObserver(HTMLDocument::Observer* observer);
sky 2015/08/12 23:54:36 Can these two be private since Observer takes care
msw 2015/08/14 23:20:34 Removed.
+ void RemoveObserver(HTMLDocument::Observer* observer);
+
blink::WebView* web_view() const { return web_view_; }
protected:
@@ -114,10 +131,14 @@ class HTMLDocument : public blink::WebViewClient,
const blink::WebString& source_name,
unsigned source_line,
const blink::WebString& stack_trace);
+ virtual void didStartLoading(bool toDifferentDocument);
yzshen1 2015/08/13 15:59:11 naming style: to_different_document, so it is cons
msw 2015/08/14 23:20:34 Removed.
+ virtual void didStopLoading();
+ virtual void didHandleOnloadEvents(blink::WebLocalFrame* frame);
virtual void didFinishLoad(blink::WebLocalFrame* frame);
virtual void didNavigateWithinPage(blink::WebLocalFrame* frame,
const blink::WebHistoryItem& history_item,
blink::WebHistoryCommitType commit_type);
+ virtual void didFirstVisuallyNonEmptyLayout(blink::WebLocalFrame* frame);
virtual blink::WebEncryptedMediaClient* encryptedMediaClient();
private:
@@ -189,6 +210,9 @@ class HTMLDocument : public blink::WebViewClient,
DeleteCallback delete_callback_;
+ StatsCollectionController* stats_collection_controller_;
yzshen1 2015/08/13 15:59:11 Please comment about ownership and when it is null
msw 2015/08/14 23:20:34 Hmm, holding gin::Wrappable objects on the heap is
+ base::ObserverList<HTMLDocument::Observer> observers_;
+
DISALLOW_COPY_AND_ASSIGN(HTMLDocument);
};

Powered by Google App Engine
This is Rietveld 408576698