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

Unified Diff: net/reporting/reporting_delegate.h

Issue 2751103002: Reporting: Wrap existing classes in context. (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/reporting/reporting_context.cc ('k') | net/reporting/reporting_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_delegate.h
diff --git a/net/reporting/reporting_delegate.h b/net/reporting/reporting_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..57d01ab4a6ae138492f55986dc3947f3c34abe70
--- /dev/null
+++ b/net/reporting/reporting_delegate.h
@@ -0,0 +1,45 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_REPORTING_REPORTING_DELEGATE_H_
+#define NET_REPORTING_REPORTING_DELEGATE_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "net/base/net_export.h"
+
+namespace base {
+class Value;
+} // namespace base
+
+namespace net {
+
+// Delegate for things that the Reporting system can't do by itself, like
+// persisting data across embedder restarts.
+class NET_EXPORT ReportingDelegate {
+ public:
+ virtual ~ReportingDelegate();
+
+ // Gets previously persisted data, if any is available. Returns a null pointer
+ // if no data is available. Can be called any number of times.
+ virtual std::unique_ptr<const base::Value> GetPersistedData() = 0;
+
+ // Sets data to be persisted across embedder restarts. Ideally, this data will
+ // be returned by any future calls to GetPersistedData() in this or future
+ // sessions (until newer data is persisted), but no guarantee is made, since
+ // the underlying persistence mechanism may or may not be reliable.
+ virtual void PersistData(
+ std::unique_ptr<const base::Value> persisted_data) = 0;
+
+ protected:
+ ReportingDelegate();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ReportingDelegate);
+};
+
+} // namespace net
+
+#endif // NET_REPORTING_REPORTING_DELEGATE_H_
« no previous file with comments | « net/reporting/reporting_context.cc ('k') | net/reporting/reporting_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698