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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 void NotifyDataUseCompleted(DataUseRecorderEntry entry); | 145 void NotifyDataUseCompleted(DataUseRecorderEntry entry); |
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, | |
156 DataUseRecorderEntry recorder); | |
tbansal1
2017/06/20 18:06:47
s/recorder/entry/
for consistency with name used i
| |
157 | |
155 // 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 |
156 // list if any entity (render frame hosts, URLRequests, pending navigations) | 159 // list if any entity (render frame hosts, URLRequests, pending navigations) |
157 // 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 |
158 // ascribing entities go away. | 161 // ascribing entities go away. |
159 DataUseRecorderList data_use_recorders_; | 162 DataUseRecorderList data_use_recorders_; |
160 | 163 |
161 // TODO(rajendrant): Combine the multiple hash_maps keyed by | 164 // TODO(rajendrant): Combine the multiple hash_maps keyed by |
162 // RenderFrameHostID. Map from RenderFrameHost to the DataUseRecorderEntry in | 165 // RenderFrameHostID. Map from RenderFrameHost to the DataUseRecorderEntry in |
163 // |data_use_recorders_| that the main frame ascribes data use to. | 166 // |data_use_recorders_| that the main frame ascribes data use to. |
164 base::hash_map<RenderFrameHostID, DataUseRecorderEntry> | 167 base::hash_map<RenderFrameHostID, DataUseRecorderEntry> |
(...skipping 20 matching lines...) Expand all Loading... | |
185 | 188 |
186 // Contains the mainframe IDs that are currently visible. | 189 // Contains the mainframe IDs that are currently visible. |
187 base::hash_set<RenderFrameHostID> visible_main_render_frames_; | 190 base::hash_set<RenderFrameHostID> visible_main_render_frames_; |
188 | 191 |
189 DISALLOW_COPY_AND_ASSIGN(ChromeDataUseAscriber); | 192 DISALLOW_COPY_AND_ASSIGN(ChromeDataUseAscriber); |
190 }; | 193 }; |
191 | 194 |
192 } // namespace data_use_measurement | 195 } // namespace data_use_measurement |
193 | 196 |
194 #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 |