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

Side by Side Diff: content/public/browser/profiler_controller.h

Issue 8588023: Collect profiler stats from browser child processes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | Annotate | Revision Log
Property Changes:
Added: svn:executable
+ *
OLDNEW
(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 class ProfilerSubscriber;
14
15 namespace base {
16 class DictionaryValue;
17 }
18
19 namespace content {
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 ProfilerController() {}
jam 2011/11/28 15:17:34 nit: not needed
ramant (doing other things) 2011/11/29 01:32:20 Done.
31 virtual ~ProfilerController() {}
32
33 // Register the subscriber so that it will be called when for example
34 // OnProfilerDataCollected is returning profiler data from a child process.
35 // This is called on UI thread.
36 virtual void Register(ProfilerSubscriber* subscriber) = 0;
37
38 // Unregister the subscriber so that it will not be called when for example
39 // OnProfilerDataCollected is returning profiler data from a child process.
40 // Safe to call even if caller is not the current subscriber.
41 virtual void Unregister(ProfilerSubscriber* subscriber) = 0;
42
43 // Send number of pending processes to subscriber.
44 // This is called on UI thread.
jam 2011/11/28 15:17:34 nit: this is the sort of stuff we should hide from
ramant (doing other things) 2011/11/29 01:32:20 Done.
45 virtual void OnPendingProcesses(int sequence_number,
46 int pending_processes) = 0;
47
48 // Send profiler_data back to subscriber.
49 // This is called on IO thread.
jam 2011/11/28 15:17:34 this function is not used by the embedder (chrome)
ramant (doing other things) 2011/11/29 01:32:20 Done.
50 virtual void OnProfilerDataCollected(
51 int sequence_number,
52 const base::DictionaryValue& profiler_data) = 0;
53
54 private:
55 DISALLOW_COPY_AND_ASSIGN(ProfilerController);
jam 2011/11/28 15:17:34 DISALLOW_COPY_AND_ASSIGN isn't needed on interface
ramant (doing other things) 2011/11/29 01:32:20 Done.
56 };
57
58 } // namespace content
59
60 #endif // CONTENT_PUBLIC_BROWSER_PROFILER_CONTROLLER_H_
61
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698