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 |
+ * |