Chromium Code Reviews
|
| 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_BROWSER_PROFILER_CONTROLLER_IMPL_H_ | |
| 6 #define CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_ | |
| 7 | |
| 8 #include "base/memory/singleton.h" | |
| 9 #include "content/common/content_export.h" | |
| 10 #include "content/public/browser/profiler_controller.h" | |
| 11 | |
| 12 namespace base { | |
| 13 class DictionaryValue; | |
|
jam
2011/11/28 15:17:34
here and below, no need to duplicate the forward d
ramant (doing other things)
2011/11/29 01:32:20
Done.
| |
| 14 } | |
| 15 | |
| 16 namespace content { | |
| 17 class ProfilerSubscriber; | |
| 18 } | |
| 19 | |
| 20 // ProfilerController's implementation. | |
| 21 class CONTENT_EXPORT ProfilerControllerImpl | |
|
jam
2011/11/28 15:17:34
nit: eventually, all the code in content will be i
ramant (doing other things)
2011/11/29 01:32:20
Done.
| |
| 22 : public content::ProfilerController { | |
| 23 public: | |
| 24 static ProfilerControllerImpl* GetInstance(); | |
| 25 | |
| 26 // Normally instantiated when the child process is launched. Only one instance | |
| 27 // should be created per process. | |
| 28 ProfilerControllerImpl(); | |
| 29 virtual ~ProfilerControllerImpl(); | |
| 30 | |
| 31 // Register the subscriber so that it will be called when for example | |
|
jam
2011/11/28 15:17:34
here and below, don't duplicate the comments from
ramant (doing other things)
2011/11/29 01:32:20
Done.
| |
| 32 // OnProfilerDataCollected is returning profiler data from a child process. | |
| 33 virtual void Register(ProfilerSubscriber* subscriber) OVERRIDE; | |
| 34 | |
| 35 // Unregister the subscriber so that it will not be called when for example | |
| 36 // OnProfilerDataCollected is returning profiler data from a child process. | |
| 37 // Safe to call even if caller is not the current subscriber. | |
| 38 virtual void Unregister(ProfilerSubscriber* subscriber) OVERRIDE; | |
| 39 | |
| 40 // Send the number of pending processes to subscriber. | |
| 41 // This is called on UI thread. | |
| 42 virtual void OnPendingProcesses(int sequence_number, | |
| 43 int pending_processes) OVERRIDE; | |
| 44 | |
| 45 // Send profiler_data back to subscriber. | |
| 46 virtual void OnProfilerDataCollected( | |
| 47 int sequence_number, | |
| 48 const base::DictionaryValue& profiler_data) OVERRIDE; | |
| 49 | |
| 50 private: | |
| 51 friend struct DefaultSingletonTraits<ProfilerControllerImpl>; | |
| 52 | |
| 53 ProfilerSubscriber* subscriber_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(ProfilerControllerImpl); | |
| 56 }; | |
| 57 | |
| 58 #endif // CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_ | |
| 59 | |
| OLD | NEW |