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

Side by Side Diff: chrome/browser/data_use_measurement/chrome_data_use_recorder.h

Issue 2534023002: Create a DataUseRecorder instance for each page load in Chrome. (Closed)
Patch Set: Remove debug logs Created 4 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_RECORDER_H_
6 #define CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_RECORDER_H_
7
8 #include <utility>
9
10 #include "base/macros.h"
11 #include "components/data_use_measurement/core/data_use_recorder.h"
12 #include "content/public/browser/global_request_id.h"
13
14 namespace data_use_measurement {
15
16 typedef std::pair<int, int> RenderFrameHostID;
17
18 class ChromeDataUseRecorder : public DataUseRecorder {
19 public:
20 ChromeDataUseRecorder();
21
22 ~ChromeDataUseRecorder();
23
24 RenderFrameHostID main_frame_id() { return main_frame_id_; }
RyanSturm 2016/11/29 20:32:59 const method
Not at Google. Contact bengr 2016/11/30 00:21:16 Done.
25
26 void set_main_frame_id(RenderFrameHostID frame_id) {
27 main_frame_id_ = frame_id;
28 }
29
30 void set_main_frame_request_id(content::GlobalRequestID request_id) {
31 main_frame_request_id_ = request_id;
32 }
33
34 content::GlobalRequestID main_frame_request_id() {
RyanSturm 2016/11/29 20:32:59 const method
Not at Google. Contact bengr 2016/11/30 00:21:16 Done.
35 return main_frame_request_id_;
36 }
37
38 private:
39 // Identifier for the main frame for the page load this recorder is tracking.
40 // Only valid if the data use is associated with a page load.
41 RenderFrameHostID main_frame_id_;
42
43 // Identifier for the MAIN_FRAME request for this page load. Only valid if
44 // the data use is associated with a page load.
45 content::GlobalRequestID main_frame_request_id_;
46 };
47
48 } // namespace data_use_measurement
49
50 #endif // CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_RECORDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698