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

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

Issue 2833523002: Adding opt out and previews type information to DRP pingback (Closed)
Patch Set: bengr comments 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 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 CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.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/common/page_load_metrics/page_load_timing.h" 15 #include "chrome/common/page_load_metrics/page_load_timing.h"
16 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data .h"
16 #include "content/public/browser/render_widget_host.h" 17 #include "content/public/browser/render_widget_host.h"
17 #include "content/public/browser/web_contents.h" 18 #include "content/public/browser/web_contents.h"
18 #include "content/public/browser/web_contents_observer.h" 19 #include "content/public/browser/web_contents_observer.h"
19 #include "content/public/browser/web_contents_user_data.h" 20 #include "content/public/browser/web_contents_user_data.h"
20 #include "content/public/common/resource_type.h" 21 #include "content/public/common/resource_type.h"
21 #include "third_party/WebKit/public/platform/WebInputEvent.h" 22 #include "third_party/WebKit/public/platform/WebInputEvent.h"
22 23
23 namespace content { 24 namespace content {
24 class NavigationHandle; 25 class NavigationHandle;
25 class RenderFrameHost; 26 class RenderFrameHost;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 const content::WebContentsObserver::MediaPlayerInfo& video_type, 70 const content::WebContentsObserver::MediaPlayerInfo& video_type,
70 const content::WebContentsObserver::MediaPlayerId& id) override; 71 const content::WebContentsObserver::MediaPlayerId& id) override;
71 72
72 // These methods are forwarded from the MetricsNavigationThrottle. 73 // These methods are forwarded from the MetricsNavigationThrottle.
73 void WillStartNavigationRequest(content::NavigationHandle* navigation_handle); 74 void WillStartNavigationRequest(content::NavigationHandle* navigation_handle);
74 void WillProcessNavigationResponse( 75 void WillProcessNavigationResponse(
75 content::NavigationHandle* navigation_handle); 76 content::NavigationHandle* navigation_handle);
76 77
77 // A resource request completed on the IO thread. This method is invoked on 78 // A resource request completed on the IO thread. This method is invoked on
78 // the UI thread. 79 // the UI thread.
79 void OnRequestComplete(const content::GlobalRequestID& request_id, 80 void OnRequestComplete(
80 content::ResourceType resource_type, 81 const content::GlobalRequestID& request_id,
81 bool was_cached, 82 content::ResourceType resource_type,
82 bool used_data_reduction_proxy, 83 bool was_cached,
83 int64_t raw_body_bytes, 84 std::unique_ptr<data_reduction_proxy::DataReductionProxyData>
84 int64_t original_content_length, 85 data_reduction_proxy_data,
85 base::TimeTicks creation_time); 86 int64_t raw_body_bytes,
87 int64_t original_content_length,
88 base::TimeTicks creation_time);
86 89
87 // Invoked on navigations where a navigation delay was added by the 90 // Invoked on navigations where a navigation delay was added by the
88 // DelayNavigationThrottle. This is a temporary method that will be removed 91 // DelayNavigationThrottle. This is a temporary method that will be removed
89 // once the experiment is complete. 92 // once the experiment is complete.
90 void OnNavigationDelayComplete(content::NavigationHandle* navigation_handle, 93 void OnNavigationDelayComplete(content::NavigationHandle* navigation_handle,
91 base::TimeDelta scheduled_delay, 94 base::TimeDelta scheduled_delay,
92 base::TimeDelta actual_delay); 95 base::TimeDelta actual_delay);
93 96
94 // Flush any buffered metrics, as part of the metrics subsystem persisting 97 // Flush any buffered metrics, as part of the metrics subsystem persisting
95 // metrics as the application goes into the background. The application may be 98 // metrics as the application goes into the background. The application may be
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 175
173 // Has the MWCO observed at least one navigation? 176 // Has the MWCO observed at least one navigation?
174 bool has_navigated_; 177 bool has_navigated_;
175 178
176 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); 179 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver);
177 }; 180 };
178 181
179 } // namespace page_load_metrics 182 } // namespace page_load_metrics
180 183
181 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ 184 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698