Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: net/reporting/reporting_context.h

Issue 2829683004: Reporting: Plumb from //chrome/browser/browsing_data. (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 NET_REPORTING_REPORTING_CONTEXT_H_ 5 #ifndef NET_REPORTING_REPORTING_CONTEXT_H_
6 #define NET_REPORTING_REPORTING_CONTEXT_H_ 6 #define NET_REPORTING_REPORTING_CONTEXT_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "net/base/backoff_entry.h" 12 #include "net/base/backoff_entry.h"
13 #include "net/base/net_export.h" 13 #include "net/base/net_export.h"
14 #include "net/reporting/reporting_policy.h" 14 #include "net/reporting/reporting_policy.h"
15 15
16 namespace base { 16 namespace base {
17 class Clock; 17 class Clock;
18 class TickClock; 18 class TickClock;
19 } // namespace base 19 } // namespace base
20 20
21 namespace net { 21 namespace net {
22 22
23 class ReportingBrowsingDataRemover;
23 class ReportingCache; 24 class ReportingCache;
24 class ReportingDelegate; 25 class ReportingDelegate;
25 class ReportingDeliveryAgent; 26 class ReportingDeliveryAgent;
26 class ReportingEndpointManager; 27 class ReportingEndpointManager;
27 class ReportingGarbageCollector; 28 class ReportingGarbageCollector;
28 class ReportingObserver; 29 class ReportingObserver;
29 class ReportingPersister; 30 class ReportingPersister;
30 class ReportingUploader; 31 class ReportingUploader;
31 class URLRequestContext; 32 class URLRequestContext;
32 33
(...skipping 26 matching lines...) Expand all
59 ReportingUploader* uploader() { return uploader_.get(); } 60 ReportingUploader* uploader() { return uploader_.get(); }
60 61
61 ReportingCache* cache() { return cache_.get(); } 62 ReportingCache* cache() { return cache_.get(); }
62 ReportingEndpointManager* endpoint_manager() { 63 ReportingEndpointManager* endpoint_manager() {
63 return endpoint_manager_.get(); 64 return endpoint_manager_.get();
64 } 65 }
65 ReportingDeliveryAgent* delivery_agent() { return delivery_agent_.get(); } 66 ReportingDeliveryAgent* delivery_agent() { return delivery_agent_.get(); }
66 ReportingGarbageCollector* garbage_collector() { 67 ReportingGarbageCollector* garbage_collector() {
67 return garbage_collector_.get(); 68 return garbage_collector_.get();
68 } 69 }
70 ReportingBrowsingDataRemover* browsing_data_remover() {
71 return browsing_data_remover_.get();
72 }
69 73
70 ReportingPersister* persister() { return persister_.get(); } 74 ReportingPersister* persister() { return persister_.get(); }
71 75
72 void AddObserver(ReportingObserver* observer); 76 void AddObserver(ReportingObserver* observer);
73 void RemoveObserver(ReportingObserver* observer); 77 void RemoveObserver(ReportingObserver* observer);
74 78
75 void NotifyCacheUpdated(); 79 void NotifyCacheUpdated();
76 80
77 protected: 81 protected:
78 ReportingContext(const ReportingPolicy& policy, 82 ReportingContext(const ReportingPolicy& policy,
(...skipping 22 matching lines...) Expand all
101 // and |endpoint_manager_|. 105 // and |endpoint_manager_|.
102 std::unique_ptr<ReportingDeliveryAgent> delivery_agent_; 106 std::unique_ptr<ReportingDeliveryAgent> delivery_agent_;
103 107
104 // |persister_| must come after |delegate_|, |clock_|, |tick_clock_|, and 108 // |persister_| must come after |delegate_|, |clock_|, |tick_clock_|, and
105 // |cache_|. 109 // |cache_|.
106 std::unique_ptr<ReportingPersister> persister_; 110 std::unique_ptr<ReportingPersister> persister_;
107 111
108 // |garbage_collector_| must come after |tick_clock_| and |cache_|. 112 // |garbage_collector_| must come after |tick_clock_| and |cache_|.
109 std::unique_ptr<ReportingGarbageCollector> garbage_collector_; 113 std::unique_ptr<ReportingGarbageCollector> garbage_collector_;
110 114
115 // |browsing_data_remover_| must come after |cache_|.
116 std::unique_ptr<ReportingBrowsingDataRemover> browsing_data_remover_;
117
111 DISALLOW_COPY_AND_ASSIGN(ReportingContext); 118 DISALLOW_COPY_AND_ASSIGN(ReportingContext);
112 }; 119 };
113 120
114 } // namespace net 121 } // namespace net
115 122
116 #endif // NET_REPORTING_REPORTING_CONTEXT_H_ 123 #endif // NET_REPORTING_REPORTING_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698