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(const ChromeDataUseRecorder& other); |
| 22 ~ChromeDataUseRecorder(); |
| 23 |
| 24 RenderFrameHostID main_frame_id() const { return main_frame_id_; } |
| 25 |
| 26 void set_main_frame_id(RenderFrameHostID frame_id) { |
| 27 main_frame_id_ = frame_id; |
| 28 } |
| 29 |
| 30 content::GlobalRequestID main_frame_request_id() const { |
| 31 return main_frame_request_id_; |
| 32 } |
| 33 |
| 34 void set_main_frame_request_id(content::GlobalRequestID request_id) { |
| 35 main_frame_request_id_ = 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_ |
OLD | NEW |