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

Unified Diff: chrome/browser/page_load_metrics/metrics_web_contents_observer.h

Issue 2847803002: Revert of Break page load metrics test dependency on IPC. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/metrics_web_contents_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/page_load_metrics/metrics_web_contents_observer.h
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
index a2e14507ed3b7b3b1b7b21cb59ff839f0c0e66c4..309685452a9246bb1e0ff5d4d38f2e13721194b1 100644
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
@@ -10,7 +10,6 @@
#include <vector>
#include "base/macros.h"
-#include "base/observer_list.h"
#include "base/time/time.h"
#include "chrome/browser/page_load_metrics/page_load_metrics_observer.h"
#include "chrome/common/page_load_metrics/page_load_timing.h"
@@ -44,27 +43,6 @@
public content::WebContentsUserData<MetricsWebContentsObserver>,
public content::RenderWidgetHost::InputEventObserver {
public:
- // TestingObserver allows tests to observe MetricsWebContentsObserver state
- // changes. Tests may use TestingObserver to wait until certain state changes,
- // such as the arrivial of PageLoadTiming messages from the render process,
- // have been observed.
- class TestingObserver {
- public:
- explicit TestingObserver(content::WebContents* web_contents);
- virtual ~TestingObserver();
-
- void OnGoingAway();
-
- // Invoked when a new PageLoadTiming update has been received and processed.
- virtual void OnTimingUpdated(const PageLoadTiming& timing,
- const PageLoadMetadata& metadata) {}
-
- private:
- page_load_metrics::MetricsWebContentsObserver* observer_;
-
- DISALLOW_COPY_AND_ASSIGN(TestingObserver);
- };
-
// Note that the returned metrics is owned by the web contents.
static MetricsWebContentsObserver* CreateForWebContents(
content::WebContents* web_contents,
@@ -125,15 +103,6 @@
// This getter function is required for testing.
const PageLoadExtraInfo GetPageLoadExtraInfoForCommittedLoad();
- // Register / unregister TestingObservers. Should only be called from tests.
- void AddTestingObserver(TestingObserver* observer);
- void RemoveTestingObserver(TestingObserver* observer);
-
- // public only for testing
- void OnTimingUpdated(content::RenderFrameHost* render_frame_host,
- const PageLoadTiming& timing,
- const PageLoadMetadata& metadata);
-
private:
friend class content::WebContentsUserData<MetricsWebContentsObserver>;
@@ -174,6 +143,10 @@
content::NavigationHandle* new_navigation,
UserInitiatedInfo user_initiated_info);
+ void OnTimingUpdated(content::RenderFrameHost*,
+ const PageLoadTiming& timing,
+ const PageLoadMetadata& metadata);
+
bool ShouldTrackNavigation(
content::NavigationHandle* navigation_handle) const;
@@ -203,8 +176,6 @@
// Has the MWCO observed at least one navigation?
bool has_navigated_;
- base::ObserverList<TestingObserver> testing_observers_;
-
DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver);
};
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/metrics_web_contents_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698