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

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

Issue 2829683004: Reporting: Plumb from //chrome/browser/browsing_data. (Closed)
Patch Set: Make requested changes. 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 ReportingNetworkChangeObserver; 29 class ReportingNetworkChangeObserver;
29 class ReportingObserver; 30 class ReportingObserver;
30 class ReportingPersister; 31 class ReportingPersister;
31 class ReportingUploader; 32 class ReportingUploader;
32 class URLRequestContext; 33 class URLRequestContext;
(...skipping 27 matching lines...) Expand all
60 ReportingUploader* uploader() { return uploader_.get(); } 61 ReportingUploader* uploader() { return uploader_.get(); }
61 62
62 ReportingCache* cache() { return cache_.get(); } 63 ReportingCache* cache() { return cache_.get(); }
63 ReportingEndpointManager* endpoint_manager() { 64 ReportingEndpointManager* endpoint_manager() {
64 return endpoint_manager_.get(); 65 return endpoint_manager_.get();
65 } 66 }
66 ReportingDeliveryAgent* delivery_agent() { return delivery_agent_.get(); } 67 ReportingDeliveryAgent* delivery_agent() { return delivery_agent_.get(); }
67 ReportingGarbageCollector* garbage_collector() { 68 ReportingGarbageCollector* garbage_collector() {
68 return garbage_collector_.get(); 69 return garbage_collector_.get();
69 } 70 }
71 ReportingBrowsingDataRemover* browsing_data_remover() {
72 return browsing_data_remover_.get();
73 }
70 74
71 ReportingPersister* persister() { return persister_.get(); } 75 ReportingPersister* persister() { return persister_.get(); }
72 76
73 void AddObserver(ReportingObserver* observer); 77 void AddObserver(ReportingObserver* observer);
74 void RemoveObserver(ReportingObserver* observer); 78 void RemoveObserver(ReportingObserver* observer);
75 79
76 void NotifyCacheUpdated(); 80 void NotifyCacheUpdated();
77 81
78 protected: 82 protected:
79 ReportingContext(const ReportingPolicy& policy, 83 ReportingContext(const ReportingPolicy& policy,
(...skipping 25 matching lines...) Expand all
105 // |persister_| must come after |delegate_|, |clock_|, |tick_clock_|, and 109 // |persister_| must come after |delegate_|, |clock_|, |tick_clock_|, and
106 // |cache_|. 110 // |cache_|.
107 std::unique_ptr<ReportingPersister> persister_; 111 std::unique_ptr<ReportingPersister> persister_;
108 112
109 // |garbage_collector_| must come after |tick_clock_| and |cache_|. 113 // |garbage_collector_| must come after |tick_clock_| and |cache_|.
110 std::unique_ptr<ReportingGarbageCollector> garbage_collector_; 114 std::unique_ptr<ReportingGarbageCollector> garbage_collector_;
111 115
112 // |network_change_observer_| must come after |cache_|. 116 // |network_change_observer_| must come after |cache_|.
113 std::unique_ptr<ReportingNetworkChangeObserver> network_change_observer_; 117 std::unique_ptr<ReportingNetworkChangeObserver> network_change_observer_;
114 118
119 // |browsing_data_remover_| must come after |cache_|.
120 std::unique_ptr<ReportingBrowsingDataRemover> browsing_data_remover_;
121
115 DISALLOW_COPY_AND_ASSIGN(ReportingContext); 122 DISALLOW_COPY_AND_ASSIGN(ReportingContext);
116 }; 123 };
117 124
118 } // namespace net 125 } // namespace net
119 126
120 #endif // NET_REPORTING_REPORTING_CONTEXT_H_ 127 #endif // NET_REPORTING_REPORTING_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698