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

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

Issue 1384213002: Page Abort Events for relevant navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests + added a test Created 5 years, 2 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
« no previous file with comments | « no previous file | components/page_load_metrics/browser/metrics_web_contents_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PAGE_LOAD_METRICS_WEB_CONTENTS_OBSE RVER_H_ 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_OBSE RVER_H_
6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_OBSE RVER_H_ 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_OBSE RVER_H_
7 7
8 #include "base/containers/scoped_ptr_map.h" 8 #include "base/containers/scoped_ptr_map.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // these counts. This includes all failed provisional loads. 45 // these counts. This includes all failed provisional loads.
46 PAGE_LOAD_ABORTED_BEFORE_FIRST_LAYOUT, 46 PAGE_LOAD_ABORTED_BEFORE_FIRST_LAYOUT,
47 47
48 // We increase this count if a page load successfully has a layout. 48 // We increase this count if a page load successfully has a layout.
49 // Differentiate between loads that were backgrounded before first layout. 49 // Differentiate between loads that were backgrounded before first layout.
50 // Note that a load that is backgrounded, then foregrounded before first 50 // Note that a load that is backgrounded, then foregrounded before first
51 // layout will still end up in the backgrounded bucket. 51 // layout will still end up in the backgrounded bucket.
52 PAGE_LOAD_SUCCESSFUL_FIRST_LAYOUT_FOREGROUND, 52 PAGE_LOAD_SUCCESSFUL_FIRST_LAYOUT_FOREGROUND,
53 PAGE_LOAD_SUCCESSFUL_FIRST_LAYOUT_BACKGROUND, 53 PAGE_LOAD_SUCCESSFUL_FIRST_LAYOUT_BACKGROUND,
54 54
55 PAGE_LOAD_ABORTED_BEFORE_FIRST_LAYOUT_RELEVANT,
Bryan McQuade 2015/10/05 17:46:00 can you add a comment for this one? what does rele
56
55 // Add values before this final count. 57 // Add values before this final count.
56 PAGE_LOAD_LAST_ENTRY 58 PAGE_LOAD_LAST_ENTRY
57 }; 59 };
58 60
59 class PageLoadTracker { 61 class PageLoadTracker {
60 public: 62 public:
61 explicit PageLoadTracker(bool in_foreground); 63 explicit PageLoadTracker(bool in_foreground);
62 ~PageLoadTracker(); 64 ~PageLoadTracker();
63 void Commit(); 65 void Commit();
64 void WebContentsHidden(); 66 void WebContentsHidden();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 base::ScopedPtrMap<content::NavigationHandle*, scoped_ptr<PageLoadTracker>> 125 base::ScopedPtrMap<content::NavigationHandle*, scoped_ptr<PageLoadTracker>>
124 provisional_loads_; 126 provisional_loads_;
125 scoped_ptr<PageLoadTracker> committed_load_; 127 scoped_ptr<PageLoadTracker> committed_load_;
126 128
127 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); 129 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver);
128 }; 130 };
129 131
130 } // namespace page_load_metrics 132 } // namespace page_load_metrics
131 133
132 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_O BSERVER_H_ 134 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_O BSERVER_H_
OLDNEW
« no previous file with comments | « no previous file | components/page_load_metrics/browser/metrics_web_contents_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698