OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_REPORTING_REPORTING_DELEGATE_H_ |
| 6 #define NET_REPORTING_REPORTING_DELEGATE_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "net/base/net_export.h" |
| 12 |
| 13 namespace base { |
| 14 class Value; |
| 15 } // namespace base |
| 16 |
| 17 namespace net { |
| 18 |
| 19 // Delegate for things that the Reporting system can't do by itself, like |
| 20 // persisting data across embedder restarts. |
| 21 class NET_EXPORT ReportingDelegate { |
| 22 public: |
| 23 virtual ~ReportingDelegate(); |
| 24 |
| 25 // Gets previously persisted data, if any is available. Returns a null pointer |
| 26 // if no data is available. Can be called any number of times. |
| 27 virtual std::unique_ptr<const base::Value> GetPersistedData() = 0; |
| 28 |
| 29 // Sets data to be persisted across embedder restarts. Ideally, this data will |
| 30 // be returned by any future calls to GetPersistedData() in this or future |
| 31 // sessions (until newer data is persisted), but no guarantee is made, since |
| 32 // the underlying persistence mechanism may or may not be reliable. |
| 33 virtual void PersistData( |
| 34 std::unique_ptr<const base::Value> persisted_data) = 0; |
| 35 |
| 36 protected: |
| 37 ReportingDelegate(); |
| 38 |
| 39 private: |
| 40 DISALLOW_COPY_AND_ASSIGN(ReportingDelegate); |
| 41 }; |
| 42 |
| 43 } // namespace net |
| 44 |
| 45 #endif // NET_REPORTING_REPORTING_DELEGATE_H_ |
OLD | NEW |