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