| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_H_ | 5 #ifndef CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_H_ |
| 6 #define CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_H_ | 6 #define CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 DataUseRecorderEntry CreateNewDataUseRecorder( | 147 DataUseRecorderEntry CreateNewDataUseRecorder( |
| 148 net::URLRequest* request, | 148 net::URLRequest* request, |
| 149 DataUse::TrafficType traffic_type); | 149 DataUse::TrafficType traffic_type); |
| 150 | 150 |
| 151 bool IsRecorderInPendingNavigationMap(net::URLRequest* request); | 151 bool IsRecorderInPendingNavigationMap(net::URLRequest* request); |
| 152 | 152 |
| 153 bool IsRecorderInRenderFrameMap(net::URLRequest* request); | 153 bool IsRecorderInRenderFrameMap(net::URLRequest* request); |
| 154 | 154 |
| 155 void AscribeRecorderWithRequest(net::URLRequest* request, | 155 void AscribeRecorderWithRequest(net::URLRequest* request, |
| 156 DataUseRecorderEntry recorder); | 156 DataUseRecorderEntry entry); |
| 157 | 157 |
| 158 // Owner for all instances of DataUseRecorder. An instance is kept in this | 158 // Owner for all instances of DataUseRecorder. An instance is kept in this |
| 159 // list if any entity (render frame hosts, URLRequests, pending navigations) | 159 // list if any entity (render frame hosts, URLRequests, pending navigations) |
| 160 // that ascribe data use to the instance exists, and deleted when all | 160 // that ascribe data use to the instance exists, and deleted when all |
| 161 // ascribing entities go away. | 161 // ascribing entities go away. |
| 162 DataUseRecorderList data_use_recorders_; | 162 DataUseRecorderList data_use_recorders_; |
| 163 | 163 |
| 164 // TODO(rajendrant): Combine the multiple hash_maps keyed by | 164 // TODO(rajendrant): Combine the multiple hash_maps keyed by |
| 165 // RenderFrameHostID. Map from RenderFrameHost to the DataUseRecorderEntry in | 165 // RenderFrameHostID. Map from RenderFrameHost to the DataUseRecorderEntry in |
| 166 // |data_use_recorders_| that the main frame ascribes data use to. | 166 // |data_use_recorders_| that the main frame ascribes data use to. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 188 | 188 |
| 189 // Contains the mainframe IDs that are currently visible. | 189 // Contains the mainframe IDs that are currently visible. |
| 190 base::hash_set<RenderFrameHostID> visible_main_render_frames_; | 190 base::hash_set<RenderFrameHostID> visible_main_render_frames_; |
| 191 | 191 |
| 192 DISALLOW_COPY_AND_ASSIGN(ChromeDataUseAscriber); | 192 DISALLOW_COPY_AND_ASSIGN(ChromeDataUseAscriber); |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 } // namespace data_use_measurement | 195 } // namespace data_use_measurement |
| 196 | 196 |
| 197 #endif // CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_H_ | 197 #endif // CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_H_ |
| OLD | NEW |