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

Side by Side Diff: content/browser/profiler_message_filter.cc

Issue 142923005: Allow MessageFilters to restrict listening to specific message classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Working patch Created 6 years, 10 months 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 unified diff | Download patch
OLDNEW
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 namespace {
14 const uint32 kFilteredMessageClasses[] = {
15 ChildProcessMsgStart
16 };
17 } // namespace
13 18
14 ProfilerMessageFilter::ProfilerMessageFilter(int process_type) 19 ProfilerMessageFilter::ProfilerMessageFilter(int process_type)
15 : process_type_(process_type) { 20 : BrowserMessageFilter(
21 kFilteredMessageClasses, arraysize(kFilteredMessageClasses)),
22 process_type_(process_type) {
16 } 23 }
17 24
18 void ProfilerMessageFilter::OnChannelConnected(int32 peer_pid) { 25 void ProfilerMessageFilter::OnChannelConnected(int32 peer_pid) {
19 tracked_objects::ThreadData::Status status = 26 tracked_objects::ThreadData::Status status =
20 tracked_objects::ThreadData::status(); 27 tracked_objects::ThreadData::status();
21 Send(new ChildProcessMsg_SetProfilerStatus(status)); 28 Send(new ChildProcessMsg_SetProfilerStatus(status));
22 } 29 }
23 30
24 bool ProfilerMessageFilter::OnMessageReceived(const IPC::Message& message, 31 bool ProfilerMessageFilter::OnMessageReceived(const IPC::Message& message,
25 bool* message_was_ok) { 32 bool* message_was_ok) {
(...skipping 19 matching lines...) Expand all
45 } 52 }
46 53
47 #if defined(USE_TCMALLOC) 54 #if defined(USE_TCMALLOC)
48 void ProfilerMessageFilter::OnTcmallocStats(const std::string& output) { 55 void ProfilerMessageFilter::OnTcmallocStats(const std::string& output) {
49 AboutTcmallocOutputs::GetInstance()->OnStatsForChildProcess( 56 AboutTcmallocOutputs::GetInstance()->OnStatsForChildProcess(
50 peer_pid(), process_type_, output); 57 peer_pid(), process_type_, output);
51 } 58 }
52 #endif 59 #endif
53 60
54 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698