Index: components/data_usage/core/data_use_annotator.h |
diff --git a/components/data_usage/core/data_use_annotator.h b/components/data_usage/core/data_use_annotator.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ea7932de044c58e771af20388e6fe8f8a9f6f485 |
--- /dev/null |
+++ b/components/data_usage/core/data_use_annotator.h |
@@ -0,0 +1,37 @@ |
+// Copyright 2015 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 COMPONENTS_DATA_USAGE_CORE_DATA_USE_ANNOTATOR_H_ |
+#define COMPONENTS_DATA_USAGE_CORE_DATA_USE_ANNOTATOR_H_ |
+ |
+#include "base/callback_forward.h" |
bengr
2015/11/05 00:00:38
Why do you need callback_forward.h and not callbac
sclittle
2015/11/05 01:22:48
We do need it now, because of the new typedef here
|
+#include "base/memory/scoped_ptr.h" |
+ |
+namespace net { |
+class URLRequest; |
+} |
+ |
+namespace data_usage { |
+ |
+struct DataUse; |
+ |
+// Interface for an object that can annotate DataUse objects with additional |
+// information. |
+class DataUseAnnotator { |
+ public: |
+ virtual ~DataUseAnnotator() {} |
+ |
+ // Annotate |data_use| with additional information, possibly from |request|, |
+ // before passing the annotated |data_use| to |callback|. |request| is passed |
+ // in as a non-const pointer so that the DataUseAnnotator can add UserData on |
+ // to the |request| if desired. |
+ virtual void Annotate( |
+ net::URLRequest* request, |
+ scoped_ptr<DataUse> data_use, |
+ const base::Callback<void(scoped_ptr<DataUse>)>& callback) = 0; |
+}; |
+ |
+} // namespace data_usage |
+ |
+#endif // COMPONENTS_DATA_USAGE_CORE_DATA_USE_ANNOTATOR_H_ |