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 content { |
| 13 |
| 14 // ProfilerController's implementation. |
| 15 class CONTENT_EXPORT ProfilerControllerImpl : public ProfilerController { |
| 16 public: |
| 17 static ProfilerControllerImpl* GetInstance(); |
| 18 |
| 19 // Normally instantiated when the child process is launched. Only one instance |
| 20 // should be created per process. |
| 21 ProfilerControllerImpl(); |
| 22 virtual ~ProfilerControllerImpl(); |
| 23 |
| 24 // ---------------------------------- |
| 25 // ProfilerController implementation: |
| 26 // ---------------------------------- |
| 27 |
| 28 virtual void Register(ProfilerSubscriber* subscriber) OVERRIDE; |
| 29 |
| 30 virtual void Unregister(ProfilerSubscriber* subscriber) OVERRIDE; |
| 31 |
| 32 // Send number of pending processes to subscriber_. |
| 33 // This is called on UI thread. |
| 34 void OnPendingProcesses(int sequence_number, int pending_processes); |
| 35 |
| 36 // Send profiler_data back to subscriber_. subscriber_ assumes the ownership |
| 37 // of profiler_data. This is called on UI thread. |
| 38 void OnProfilerDataCollected(int sequence_number, |
| 39 base::DictionaryValue* profiler_data); |
| 40 |
| 41 private: |
| 42 friend struct DefaultSingletonTraits<ProfilerControllerImpl>; |
| 43 |
| 44 ProfilerSubscriber* subscriber_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(ProfilerControllerImpl); |
| 47 }; |
| 48 |
| 49 } // namespace content |
| 50 |
| 51 #endif // CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_ |
| 52 |
OLD | NEW |