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

Unified Diff: components/data_usage/core/data_use_annotator.h

Issue 1421983002: Include tab IDs when reporting data use accounting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data_use_scoped_vector
Patch Set: Fixed external_data_use_observer test Created 5 years, 1 month 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 | « components/data_usage/core/data_use_aggregator_unittest.cc ('k') | net/base/layered_network_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5e1a0316a30fd6feae42fed0c809795fdc900940
--- /dev/null
+++ b/components/data_usage/core/data_use_annotator.h
@@ -0,0 +1,38 @@
+// 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.h"
+#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:
+ typedef base::Callback<void(scoped_ptr<DataUse>)> DataUseConsumerCallback;
+
+ 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 DataUseConsumerCallback& callback) = 0;
+};
+
+} // namespace data_usage
+
+#endif // COMPONENTS_DATA_USAGE_CORE_DATA_USE_ANNOTATOR_H_
« no previous file with comments | « components/data_usage/core/data_use_aggregator_unittest.cc ('k') | net/base/layered_network_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698