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

Side by Side Diff: components/page_load_metrics/browser/metrics_web_contents_observer.h

Issue 1916913008: This patch uses the WebContents' opener to extract the previous committed url for the very first na… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_
6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // MetricsWebContentsObserver manages a set of provisional PageLoadTrackers, as 104 // MetricsWebContentsObserver manages a set of provisional PageLoadTrackers, as
105 // well as a committed PageLoadTracker. 105 // well as a committed PageLoadTracker.
106 class PageLoadTracker { 106 class PageLoadTracker {
107 public: 107 public:
108 // Caller must guarantee that the embedder_interface pointer outlives this 108 // Caller must guarantee that the embedder_interface pointer outlives this
109 // class. The PageLoadTracker must not hold on to 109 // class. The PageLoadTracker must not hold on to
110 // currently_committed_load_or_null or navigation_handle beyond the scope of 110 // currently_committed_load_or_null or navigation_handle beyond the scope of
111 // the constructor. 111 // the constructor.
112 PageLoadTracker(bool in_foreground, 112 PageLoadTracker(bool in_foreground,
113 PageLoadMetricsEmbedderInterface* embedder_interface, 113 PageLoadMetricsEmbedderInterface* embedder_interface,
114 PageLoadTracker* const currently_committed_load_or_null, 114 const GURL& currently_committed_url,
115 content::NavigationHandle* navigation_handle, 115 content::NavigationHandle* navigation_handle,
116 int aborted_chain_size, 116 int aborted_chain_size,
117 int aborted_chain_size_same_url); 117 int aborted_chain_size_same_url);
118 ~PageLoadTracker(); 118 ~PageLoadTracker();
119 void Redirect(content::NavigationHandle* navigation_handle); 119 void Redirect(content::NavigationHandle* navigation_handle);
120 void Commit(content::NavigationHandle* navigation_handle); 120 void Commit(content::NavigationHandle* navigation_handle);
121 void FailedProvisionalLoad(content::NavigationHandle* navigation_handle); 121 void FailedProvisionalLoad(content::NavigationHandle* navigation_handle);
122 void WebContentsHidden(); 122 void WebContentsHidden();
123 void WebContentsShown(); 123 void WebContentsShown();
124 124
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 // Tracks aborted provisional loads for a little bit longer than usual (one 286 // Tracks aborted provisional loads for a little bit longer than usual (one
287 // more navigation commit at the max), in order to better understand how the 287 // more navigation commit at the max), in order to better understand how the
288 // navigation failed. This is because most provisional loads are destroyed and 288 // navigation failed. This is because most provisional loads are destroyed and
289 // vanish before we get signal about what caused the abort (new navigation, 289 // vanish before we get signal about what caused the abort (new navigation,
290 // stop button, etc.). 290 // stop button, etc.).
291 std::vector<scoped_ptr<PageLoadTracker>> aborted_provisional_loads_; 291 std::vector<scoped_ptr<PageLoadTracker>> aborted_provisional_loads_;
292 292
293 scoped_ptr<PageLoadTracker> committed_load_; 293 scoped_ptr<PageLoadTracker> committed_load_;
294 294
295 // Has the MWCO observed at least one navigation?
296 bool has_navigated_;
297
295 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); 298 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver);
296 }; 299 };
297 300
298 } // namespace page_load_metrics 301 } // namespace page_load_metrics
299 302
300 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ 303 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698