|
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 // Contact all processes and ask them to profiler data. It returns 2 to indicate | |
jam
2011/11/30 00:22:25
it seems that these methods belong on ProfileContr
ramant (doing other things)
2011/11/30 19:37:21
Done.
| |
22 // that ProfilerControllerImpl's OnPendingProcesses will be called once for | |
jam
2011/11/30 00:22:25
nit: the comment in the interface shouldn't descri
ramant (doing other things)
2011/11/30 19:37:21
Done.
| |
23 // renderer processes and another for browser child processes. | |
24 CONTENT_EXPORT int GetProfilerData(int sequence_number); | |
25 | |
26 // Contact all processes and set profiler status to |enable|. | |
27 CONTENT_EXPORT void SetProfilerStatus(bool enable); | |
28 | |
29 // ProfilerController is used on the browser process to collect profiler data. | |
30 // Only the browser UI thread is allowed to interact with the ProfilerController | |
31 // object. | |
32 class CONTENT_EXPORT ProfilerController { | |
33 public: | |
34 // Returns the ProfilerController object for the current process, or NULL if | |
35 // none. | |
36 static ProfilerController* GetInstance(); | |
37 | |
38 virtual ~ProfilerController() {} | |
39 | |
40 // Register the subscriber so that it will be called when for example | |
41 // OnProfilerDataCollected is returning profiler data from a child process. | |
42 // This is called on UI thread. | |
43 virtual void Register(ProfilerSubscriber* subscriber) = 0; | |
44 | |
45 // Unregister the subscriber so that it will not be called when for example | |
46 // OnProfilerDataCollected is returning profiler data from a child process. | |
47 // Safe to call even if caller is not the current subscriber. | |
48 virtual void Unregister(ProfilerSubscriber* subscriber) = 0; | |
49 }; | |
50 | |
51 } // namespace content | |
52 | |
53 #endif // CONTENT_PUBLIC_BROWSER_PROFILER_CONTROLLER_H_ | |
54 | |
OLD | NEW |