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_ASCRIBER_H_ | |
6 #define CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_H_ | |
7 | |
8 #include "components/data_use_measurement/core/data_use_ascriber.h" | |
9 #include "net/base/layered_network_delegate.h" | |
10 #include "url/gurl.h" | |
11 | |
12 namespace content { | |
13 class NavigationHandle; | |
14 class RenderFrameHost; | |
15 } | |
16 | |
17 namespace data_use_measurement { | |
18 // Browser implementation of |DataUseAscriber|. Maintains a list of | |
19 // |DataUseRecorder| instances, one for each source of data, such as a page | |
20 // load. | |
21 // | |
22 // A page includes all resources loaded in response to a main page navigation. | |
23 // The scope of a page load ends either when the tab is closed or a new page | |
24 // load is initiated by clicking on a link, entering a new URL, window location | |
25 // change, etc | |
26 // | |
27 // For URLRequests initiated outside the context of a page load, such as | |
28 // Service Workers, Chrome Services, etc, a new instance of |DataUseRecorder| | |
29 // will be created for each |URLRequest|. | |
30 // | |
31 // Each page load will be associated with an instance of |DataUseRecorder|. | |
32 // Each URLRequest initiated in the context of a page load will be mapped to | |
33 // the |DataUseRecorder| instance for page load. | |
34 // | |
35 // This class lives entirely on the IO thread. It maintains a copy of frame and | |
36 // navigation information on the IO thread. | |
37 class ChromeDataUseAscriber : public DataUseAscriber { | |
38 public: | |
39 ChromeDataUseAscriber(); | |
40 | |
41 ~ChromeDataUseAscriber() override; | |
42 | |
43 DataUseRecorder* GetDataUseRecorder(const net::URLRequest* request) override; | |
44 | |
45 void RenderFrameCreated(int render_process_id, | |
bengr
2016/09/01 00:16:55
All of these public methods need comments.
Not at Google. Contact bengr
2016/09/07 23:38:37
Done.
| |
46 int render_frame_id, | |
47 int parent_render_process_id, | |
48 int parent_render_frame_id); | |
49 | |
50 void RenderFrameDeleted(int render_process_id, | |
51 int render_frame_id, | |
52 int parent_render_process_id, | |
53 int parent_render_frame_id); | |
54 | |
55 void DidStartMainFrameNavigation(GURL gurl, | |
56 int render_process_id, | |
57 int render_frame_id, | |
58 void* navigation_handle); | |
59 | |
60 void DidFinishMainFrameNavigation(GURL gurl, | |
61 int render_process_id, | |
62 int render_frame_id, | |
63 bool is_same_page_navigation, | |
64 void* navigation_handle); | |
65 | |
66 void DidRedirectMainFrameNavigation(GURL gurl, | |
67 int render_process_id, | |
68 int render_frame_id, | |
69 void* navigation_handle); | |
70 }; | |
71 | |
72 } // namespace data_use_measurement | |
bengr
2016/09/01 00:16:55
DISALLOW_COPY_AND_ASSIGN?
Not at Google. Contact bengr
2016/09/07 23:38:37
Done.
| |
73 | |
74 #endif // CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_H_ | |
OLD | NEW |