OLD | NEW |
(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 ~ChromeDataUseRecorder(); |
| 22 |
| 23 RenderFrameHostID main_frame_id() const { return main_frame_id_; } |
| 24 |
| 25 void set_main_frame_id(RenderFrameHostID frame_id) { |
| 26 main_frame_id_ = frame_id; |
| 27 } |
| 28 |
| 29 content::GlobalRequestID main_frame_request_id() const { |
| 30 return main_frame_request_id_; |
| 31 } |
| 32 |
| 33 void set_main_frame_request_id(content::GlobalRequestID request_id) { |
| 34 main_frame_request_id_ = request_id; |
| 35 } |
| 36 |
| 37 private: |
| 38 // Identifier for the main frame for the page load this recorder is tracking. |
| 39 // Only valid if the data use is associated with a page load. |
| 40 RenderFrameHostID main_frame_id_; |
| 41 |
| 42 // Identifier for the MAIN_FRAME request for this page load. Only valid if |
| 43 // the data use is associated with a page load. |
| 44 content::GlobalRequestID main_frame_request_id_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(ChromeDataUseRecorder); |
| 47 }; |
| 48 |
| 49 } // namespace data_use_measurement |
| 50 |
| 51 #endif // CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_RECORDER_H_ |
OLD | NEW |