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_ascriber.h

Issue 2950603003: Minor refactor to get rid of a friend association (Closed)
Patch Set: Created 3 years, 6 months 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
« no previous file with comments | « no previous file | chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698