Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
|
bengr
2015/11/05 00:00:38
Remove the "(c)" as per the latest hotness.
sclittle
2015/11/05 01:22:48
Done.
| |
| 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 CHROME_BROWSER_DATA_USAGE_TAB_ID_ANNOTATOR_H_ | |
| 6 #define CHROME_BROWSER_DATA_USAGE_TAB_ID_ANNOTATOR_H_ | |
| 7 | |
| 8 #include "base/callback_forward.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/threading/thread_checker.h" | |
| 12 #include "components/data_usage/core/data_use_annotator.h" | |
| 13 | |
| 14 namespace data_usage { | |
| 15 struct DataUse; | |
| 16 } | |
| 17 | |
| 18 namespace net { | |
| 19 class URLRequest; | |
| 20 } | |
| 21 | |
| 22 namespace chrome_browser_data_usage { | |
| 23 | |
| 24 // Class that annotates DataUse objects with their associated tab IDs. | |
| 25 class TabIdAnnotator : public data_usage::DataUseAnnotator { | |
| 26 public: | |
| 27 TabIdAnnotator(); | |
| 28 ~TabIdAnnotator() override; | |
| 29 | |
| 30 // Determines the tab ID associated with |request| if there is one, setting | |
| 31 // the tab ID on |data_use| appropriately and passing it to |callback| once | |
| 32 // the tab ID is ready. A tab ID of -1 is used if no tab ID is found for | |
| 33 // |request|. This method will attach a new TabIdProvider to |request| as user | |
| 34 // data if there isn't one attached already and |request| has enough | |
| 35 // information to get a tab ID. | |
| 36 void Annotate(net::URLRequest* request, | |
| 37 scoped_ptr<data_usage::DataUse> data_use, | |
| 38 const base::Callback<void(scoped_ptr<data_usage::DataUse>)>& | |
| 39 callback) override; | |
| 40 | |
| 41 private: | |
| 42 base::ThreadChecker thread_checker_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(TabIdAnnotator); | |
| 45 }; | |
| 46 | |
| 47 } // namespace chrome_browser_data_usage | |
| 48 | |
| 49 #endif // CHROME_BROWSER_DATA_USAGE_TAB_ID_ANNOTATOR_H_ | |
| OLD | NEW |