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

Unified 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, 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/public/browser/profiler_controller.h
===================================================================
--- content/public/browser/profiler_controller.h (revision 0)
+++ content/public/browser/profiler_controller.h (revision 0)
@@ -0,0 +1,61 @@
+// 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_PUBLIC_BROWSER_PROFILER_CONTROLLER_H_
+#define CONTENT_PUBLIC_BROWSER_PROFILER_CONTROLLER_H_
+
+#include <set>
+#include <string>
+
+#include "content/common/content_export.h"
+
+class ProfilerSubscriber;
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace content {
+
+// ProfilerController is used on the browser process to collect profiler data.
+// Only the browser UI thread is allowed to interact with the ProfilerController
+// object.
+class CONTENT_EXPORT ProfilerController {
+ public:
+ // Returns the ProfilerController object for the current process, or NULL if
+ // none.
+ static ProfilerController* GetInstance();
+
+ ProfilerController() {}
jam 2011/11/28 15:17:34 nit: not needed
ramant (doing other things) 2011/11/29 01:32:20 Done.
+ virtual ~ProfilerController() {}
+
+ // Register the subscriber so that it will be called when for example
+ // OnProfilerDataCollected is returning profiler data from a child process.
+ // This is called on UI thread.
+ virtual void Register(ProfilerSubscriber* subscriber) = 0;
+
+ // 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) = 0;
+
+ // Send number of pending processes to subscriber.
+ // 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.
+ virtual void OnPendingProcesses(int sequence_number,
+ int pending_processes) = 0;
+
+ // Send profiler_data back to subscriber.
+ // 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.
+ virtual void OnProfilerDataCollected(
+ int sequence_number,
+ const base::DictionaryValue& profiler_data) = 0;
+
+ private:
+ 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.
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_PROFILER_CONTROLLER_H_
+
Property changes on: content\public\browser\profiler_controller.h
___________________________________________________________________
Added: svn:executable
+ *

Powered by Google App Engine
This is Rietveld 408576698