OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/profiler_message_filter.h" | 5 #include "content/browser/profiler_message_filter.h" |
6 | 6 |
7 #include "base/tracked_objects.h" | 7 #include "base/tracked_objects.h" |
8 #include "content/browser/profiler_controller_impl.h" | 8 #include "content/browser/profiler_controller_impl.h" |
9 #include "content/browser/tcmalloc_internals_request_job.h" | 9 #include "content/browser/tcmalloc_internals_request_job.h" |
10 #include "content/common/child_process_messages.h" | 10 #include "content/common/child_process_messages.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 ProfilerMessageFilter::ProfilerMessageFilter(int process_type) | 14 ProfilerMessageFilter::ProfilerMessageFilter(content::ProcessType process_type) |
15 : BrowserMessageFilter(ChildProcessMsgStart), | 15 : BrowserMessageFilter(ChildProcessMsgStart), process_type_(process_type) { |
16 process_type_(process_type) { | |
17 } | 16 } |
18 | 17 |
19 void ProfilerMessageFilter::OnChannelConnected(int32 peer_pid) { | 18 void ProfilerMessageFilter::OnChannelConnected(int32 peer_pid) { |
20 tracked_objects::ThreadData::Status status = | 19 tracked_objects::ThreadData::Status status = |
21 tracked_objects::ThreadData::status(); | 20 tracked_objects::ThreadData::status(); |
22 Send(new ChildProcessMsg_SetProfilerStatus(status)); | 21 Send(new ChildProcessMsg_SetProfilerStatus(status)); |
23 } | 22 } |
24 | 23 |
25 bool ProfilerMessageFilter::OnMessageReceived(const IPC::Message& message) { | 24 bool ProfilerMessageFilter::OnMessageReceived(const IPC::Message& message) { |
26 bool handled = true; | 25 bool handled = true; |
(...skipping 18 matching lines...) Expand all Loading... |
45 } | 44 } |
46 | 45 |
47 #if defined(USE_TCMALLOC) | 46 #if defined(USE_TCMALLOC) |
48 void ProfilerMessageFilter::OnTcmallocStats(const std::string& output) { | 47 void ProfilerMessageFilter::OnTcmallocStats(const std::string& output) { |
49 AboutTcmallocOutputs::GetInstance()->OnStatsForChildProcess( | 48 AboutTcmallocOutputs::GetInstance()->OnStatsForChildProcess( |
50 peer_pid(), process_type_, output); | 49 peer_pid(), process_type_, output); |
51 } | 50 } |
52 #endif | 51 #endif |
53 | 52 |
54 } | 53 } |
OLD | NEW |