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

Unified Diff: content/browser/profiler_controller_impl.h

Issue 8588023: Collect profiler stats from browser child processes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/profiler_controller_impl.h
===================================================================
--- content/browser/profiler_controller_impl.h (revision 0)
+++ content/browser/profiler_controller_impl.h (revision 0)
@@ -0,0 +1,59 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_
+#define CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_
+
+#include "base/memory/singleton.h"
+#include "content/common/content_export.h"
+#include "content/public/browser/profiler_controller.h"
+
+namespace base {
+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.
+}
+
+namespace content {
+class ProfilerSubscriber;
+}
+
+// ProfilerController's implementation.
+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.
+ : public content::ProfilerController {
+ public:
+ static ProfilerControllerImpl* GetInstance();
+
+ // Normally instantiated when the child process is launched. Only one instance
+ // should be created per process.
+ ProfilerControllerImpl();
+ virtual ~ProfilerControllerImpl();
+
+ // 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.
+ // OnProfilerDataCollected is returning profiler data from a child process.
+ virtual void Register(ProfilerSubscriber* subscriber) OVERRIDE;
+
+ // Unregister the subscriber so that it will not be called when for example
+ // OnProfilerDataCollected is returning profiler data from a child process.
+ // Safe to call even if caller is not the current subscriber.
+ virtual void Unregister(ProfilerSubscriber* subscriber) OVERRIDE;
+
+ // Send the number of pending processes to subscriber.
+ // This is called on UI thread.
+ virtual void OnPendingProcesses(int sequence_number,
+ int pending_processes) OVERRIDE;
+
+ // Send profiler_data back to subscriber.
+ virtual void OnProfilerDataCollected(
+ int sequence_number,
+ const base::DictionaryValue& profiler_data) OVERRIDE;
+
+ private:
+ friend struct DefaultSingletonTraits<ProfilerControllerImpl>;
+
+ ProfilerSubscriber* subscriber_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProfilerControllerImpl);
+};
+
+#endif // CONTENT_BROWSER_PROFILER_CONTROLLER_IMPL_H_
+
Property changes on: content\browser\profiler_controller_impl.h
___________________________________________________________________
Added: svn:executable
+ *

Powered by Google App Engine
This is Rietveld 408576698