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

Unified Diff: content/browser/profiler_controller.cc

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.cc
===================================================================
--- content/browser/profiler_controller.cc (revision 0)
+++ content/browser/profiler_controller.cc (revision 0)
@@ -0,0 +1,53 @@
+// 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.
+
+#include "content/browser/profiler_controller.h"
+
+#include "base/bind.h"
+#include "content/browser/browser_message_filter.h"
+#include "content/browser/profiler_message_filter.h"
+
+using content::BrowserThread;
+
+ProfilerSubscriber::~ProfilerSubscriber() {
+}
+
+ProfilerController::ProfilerController() : subscriber_(NULL) {
+}
+
+ProfilerController::~ProfilerController() {
+}
+
+ProfilerController* ProfilerController::GetInstance() {
+ return Singleton<ProfilerController>::get();
+}
+
+void ProfilerController::RegisterSubscriber(ProfilerSubscriber* subscriber) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(!subscriber_);
+ subscriber_ = subscriber;
+}
+
+void ProfilerController::CancelSubscriber(ProfilerSubscriber* subscriber) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ if (subscriber == subscriber_) {
+ subscriber_ = NULL;
+ }
+}
+
+void ProfilerController::OnProfilerDataCollected(
+ int sequence_number,
+ const std::string& profiler_data) {
+ if (subscriber_) {
+ subscriber_->OnBrowserChildProfilerDataCollected(
+ sequence_number, profiler_data);
+ }
+}
+
+void ProfilerController::OnIsProfilerEnabled(base::ProcessId child_process_id) {
+ if (subscriber_) {
+ subscriber_->OnIsProfilerEnabledForChildProcess(child_process_id);
+ }
+}
Property changes on: content\browser\profiler_controller.cc
___________________________________________________________________
Added: svn:executable
+ *

Powered by Google App Engine
This is Rietveld 408576698