OLD | NEW |
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_DELIVERY_AGENT_H_ | 5 #ifndef NET_REPORTING_REPORTING_DELIVERY_AGENT_H_ |
6 #define NET_REPORTING_REPORTING_DELIVERY_AGENT_H_ | 6 #define NET_REPORTING_REPORTING_DELIVERY_AGENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // TODO(juliatuttle): Consider capping the maximum number of reports per | 48 // TODO(juliatuttle): Consider capping the maximum number of reports per |
49 // delivery attempt. | 49 // delivery attempt. |
50 class NET_EXPORT ReportingDeliveryAgent { | 50 class NET_EXPORT ReportingDeliveryAgent { |
51 public: | 51 public: |
52 // Creates a ReportingDeliveryAgent. |context| must outlive the agent. | 52 // Creates a ReportingDeliveryAgent. |context| must outlive the agent. |
53 static std::unique_ptr<ReportingDeliveryAgent> Create( | 53 static std::unique_ptr<ReportingDeliveryAgent> Create( |
54 ReportingContext* context); | 54 ReportingContext* context); |
55 | 55 |
56 virtual ~ReportingDeliveryAgent(); | 56 virtual ~ReportingDeliveryAgent(); |
57 | 57 |
58 // Initializes the DeliveryAgent, which schedules delivery (after the Policy's | |
59 // delivery_interval) for any previously-persisted reports that can still be | |
60 // delivered. | |
61 virtual void Initialize() = 0; | |
62 | |
63 // Replaces the internal Timer used for scheduling report delivery attempts | 58 // Replaces the internal Timer used for scheduling report delivery attempts |
64 // with a caller-specified one so that unittests can provide a MockTimer. | 59 // with a caller-specified one so that unittests can provide a MockTimer. |
65 virtual void SetTimerForTesting(std::unique_ptr<base::Timer> timer) = 0; | 60 virtual void SetTimerForTesting(std::unique_ptr<base::Timer> timer) = 0; |
66 }; | 61 }; |
67 | 62 |
68 } // namespace net | 63 } // namespace net |
69 | 64 |
70 #endif // NET_REPORTING_REPORTING_DELIVERY_AGENT_H_ | 65 #endif // NET_REPORTING_REPORTING_DELIVERY_AGENT_H_ |
OLD | NEW |