Index: content/browser/profiler_message_filter.cc |
=================================================================== |
--- content/browser/profiler_message_filter.cc (revision 0) |
+++ content/browser/profiler_message_filter.cc (revision 0) |
@@ -0,0 +1,43 @@ |
+// 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_message_filter.h" |
+ |
+#include "base/tracked_objects.h" |
+#include "content/browser/profiler_controller.h" |
+#include "content/common/child_process_messages.h" |
+ |
+using content::BrowserThread; |
+ |
+ProfilerMessageFilter::ProfilerMessageFilter() { |
+} |
+ |
+ProfilerMessageFilter::~ProfilerMessageFilter() { |
+} |
+ |
+bool ProfilerMessageFilter::OnMessageReceived(const IPC::Message& message, |
+ bool* message_was_ok) { |
+ // Always on IO thread (BrowserMessageFilter guarantee). |
jam
2011/11/19 23:36:25
nit: this comment is unnecessary
ramant (doing other things)
2011/11/25 23:59:48
Done.
|
+ bool handled = true; |
+ IPC_BEGIN_MESSAGE_MAP_EX(ProfilerMessageFilter, message, *message_was_ok) |
+ IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ChildProfilerData, |
+ OnChildProfilerData) |
+ IPC_MESSAGE_HANDLER(ChildProcessHostMsg_IsProfilerEnabled, |
+ OnIsProfilerEnabled) |
+ IPC_MESSAGE_UNHANDLED(handled = false) |
+ IPC_END_MESSAGE_MAP_EX() |
+ return handled; |
+} |
+ |
+void ProfilerMessageFilter::OnChildProfilerData( |
+ int sequence_number, |
+ const std::string& profiler_data) { |
+ ProfilerController::GetInstance()->OnProfilerDataCollected( |
+ sequence_number, profiler_data); |
+} |
+ |
+void ProfilerMessageFilter::OnIsProfilerEnabled( |
+ base::ProcessId child_process_id) { |
+ ProfilerController::GetInstance()->OnIsProfilerEnabled(child_process_id); |
+} |
Property changes on: content\browser\profiler_message_filter.cc |
___________________________________________________________________ |
Added: svn:executable |
+ * |