OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_HISTOGRAM_CONTROLLER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_HISTOGRAM_CONTROLLER_H_ |
| 7 |
| 8 #include <set> |
| 9 #include <string> |
| 10 |
| 11 #include "base/metrics/histogram.h" |
| 12 #include "content/common/content_export.h" |
| 13 |
| 14 |
| 15 namespace base { |
| 16 class DictionaryValue; |
| 17 } |
| 18 |
| 19 namespace content { |
| 20 |
| 21 class HistogramSubscriber; |
| 22 |
| 23 // HistogramController is used on the browser process to collect histogram data. |
| 24 // Only the browser UI thread is allowed to interact with the |
| 25 // HistogramController object. |
| 26 class CONTENT_EXPORT HistogramController { |
| 27 public: |
| 28 // Returns the HistogramController object for the current process, or NULL if |
| 29 // none. |
| 30 static HistogramController* GetInstance(); |
| 31 |
| 32 virtual ~HistogramController() {} |
| 33 |
| 34 // Register the subscriber so that it will be called when for example |
| 35 // OnHistogramDataCollected is returning histogram data from a child process. |
| 36 // This is called on UI thread. |
| 37 virtual void Register(HistogramSubscriber* subscriber) = 0; |
| 38 |
| 39 // Unregister the subscriber so that it will not be called when for example |
| 40 // OnHistogramDataCollected is returning histogram data from a child process. |
| 41 // Safe to call even if caller is not the current subscriber. |
| 42 virtual void Unregister(const HistogramSubscriber* subscriber) = 0; |
| 43 |
| 44 // Contact all processes and get their histogram data. |
| 45 virtual void GetHistogramData(int sequence_number) = 0; |
| 46 }; |
| 47 |
| 48 } // namespace content |
| 49 |
| 50 #endif // CONTENT_PUBLIC_BROWSER_HISTOGRAM_CONTROLLER_H_ |
OLD | NEW |