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

Side by Side Diff: chrome/browser/page_load_metrics/page_load_tracker.h

Issue 2732293003: Adding UMA on page load size for pages with Media (Closed)
Patch Set: bmcquade comment Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/optional.h" 12 #include "base/optional.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" 14 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h"
15 #include "chrome/browser/page_load_metrics/user_input_tracker.h" 15 #include "chrome/browser/page_load_metrics/user_input_tracker.h"
16 #include "chrome/common/page_load_metrics/page_load_timing.h" 16 #include "chrome/common/page_load_metrics/page_load_timing.h"
17 #include "content/public/browser/global_request_id.h" 17 #include "content/public/browser/global_request_id.h"
18 #include "content/public/browser/web_contents_observer.h"
18 #include "ui/base/page_transition_types.h" 19 #include "ui/base/page_transition_types.h"
19 20
20 class GURL; 21 class GURL;
21 22
22 namespace blink { 23 namespace blink {
23 class WebInputEvent; 24 class WebInputEvent;
24 } // namespace blink 25 } // namespace blink
25 26
26 namespace content { 27 namespace content {
27 class NavigationHandle; 28 class NavigationHandle;
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 UserInputTracker* input_tracker() { return &input_tracker_; } 225 UserInputTracker* input_tracker() { return &input_tracker_; }
225 226
226 // Whether this PageLoadTracker has a navigation GlobalRequestID that matches 227 // Whether this PageLoadTracker has a navigation GlobalRequestID that matches
227 // the given request_id. This method will return false before 228 // the given request_id. This method will return false before
228 // WillProcessNavigationResponse has been invoked, as PageLoadTracker doesn't 229 // WillProcessNavigationResponse has been invoked, as PageLoadTracker doesn't
229 // know its GlobalRequestID until WillProcessNavigationResponse has been 230 // know its GlobalRequestID until WillProcessNavigationResponse has been
230 // invoked. 231 // invoked.
231 bool HasMatchingNavigationRequestID( 232 bool HasMatchingNavigationRequestID(
232 const content::GlobalRequestID& request_id) const; 233 const content::GlobalRequestID& request_id) const;
233 234
235 // Invoked when a media element starts playing.
236 void MediaStartedPlaying(
237 const content::WebContentsObserver::MediaPlayerInfo& video_type,
238 bool is_in_main_frame);
239
234 private: 240 private:
235 // This function converts a TimeTicks value taken in the browser process 241 // This function converts a TimeTicks value taken in the browser process
236 // to navigation_start_ if: 242 // to navigation_start_ if:
237 // - base::TimeTicks is not comparable across processes because the clock 243 // - base::TimeTicks is not comparable across processes because the clock
238 // is not system wide monotonic. 244 // is not system wide monotonic.
239 // - *event_time < navigation_start_ 245 // - *event_time < navigation_start_
240 void ClampBrowserTimestampIfInterProcessTimeTickSkew( 246 void ClampBrowserTimestampIfInterProcessTimeTickSkew(
241 base::TimeTicks* event_time); 247 base::TimeTicks* event_time);
242 248
243 void UpdatePageEndInternal(PageEndReason page_end_reason, 249 void UpdatePageEndInternal(PageEndReason page_end_reason,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 PageLoadMetricsEmbedderInterface* const embedder_interface_; 334 PageLoadMetricsEmbedderInterface* const embedder_interface_;
329 335
330 std::vector<std::unique_ptr<PageLoadMetricsObserver>> observers_; 336 std::vector<std::unique_ptr<PageLoadMetricsObserver>> observers_;
331 337
332 DISALLOW_COPY_AND_ASSIGN(PageLoadTracker); 338 DISALLOW_COPY_AND_ASSIGN(PageLoadTracker);
333 }; 339 };
334 340
335 } // namespace page_load_metrics 341 } // namespace page_load_metrics
336 342
337 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ 343 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_
OLDNEW
« no previous file with comments | « chrome/browser/page_load_metrics/page_load_metrics_observer.h ('k') | chrome/browser/page_load_metrics/page_load_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698