OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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_ |
OLD | NEW |