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

Side by Side Diff: chrome/browser/data_usage/tab_id_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 unified diff | Download patch
« no previous file with comments | « chrome/browser/data_usage/OWNERS ('k') | chrome/browser/data_usage/tab_id_annotator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 CHROME_BROWSER_DATA_USAGE_TAB_ID_ANNOTATOR_H_
6 #define CHROME_BROWSER_DATA_USAGE_TAB_ID_ANNOTATOR_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/threading/thread_checker.h"
11 #include "components/data_usage/core/data_use_annotator.h"
12
13 namespace data_usage {
14 struct DataUse;
15 }
16
17 namespace net {
18 class URLRequest;
19 }
20
21 namespace chrome_browser_data_usage {
22
23 // Class that annotates DataUse objects with their associated tab IDs.
24 class TabIdAnnotator : public data_usage::DataUseAnnotator {
25 public:
26 TabIdAnnotator();
27 ~TabIdAnnotator() override;
28
29 // Determines the tab ID associated with |request| if there is one, setting
30 // the tab ID on |data_use| appropriately and passing it to |callback| once
31 // the tab ID is ready. A tab ID of -1 is used if no tab ID is found for
32 // |request|. This method will attach a new TabIdProvider to |request| as user
33 // data if there isn't one attached already and |request| has enough
34 // information to get a tab ID.
35 void Annotate(net::URLRequest* request,
36 scoped_ptr<data_usage::DataUse> data_use,
37 const DataUseConsumerCallback& callback) override;
38
39 private:
40 base::ThreadChecker thread_checker_;
41
42 DISALLOW_COPY_AND_ASSIGN(TabIdAnnotator);
43 };
44
45 } // namespace chrome_browser_data_usage
46
47 #endif // CHROME_BROWSER_DATA_USAGE_TAB_ID_ANNOTATOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/data_usage/OWNERS ('k') | chrome/browser/data_usage/tab_id_annotator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698