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

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

Issue 8588023: Collect profiler stats from browser child processes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | Annotate | Revision Log
Property Changes:
Added: svn:executable
+ *
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/profiler_message_filter.h"
6
7 #include "base/tracked_objects.h"
8 #include "base/values.h"
9 #include "content/browser/profiler_controller_impl.h"
10 #include "content/common/child_process_messages.h"
11
12 using content::BrowserThread;
13
14 ProfilerMessageFilter::ProfilerMessageFilter() {
15 }
16
17 ProfilerMessageFilter::~ProfilerMessageFilter() {
18 }
19
20 void ProfilerMessageFilter::OnChannelConnected(int32 peer_pid) {
21 BrowserMessageFilter::OnChannelConnected(peer_pid);
22
23 bool enable = tracked_objects::ThreadData::tracking_status();
24 Send(new ChildProcessMsg_SetProfilerStatus(enable));
25 }
26
27 bool ProfilerMessageFilter::OnMessageReceived(const IPC::Message& message,
28 bool* message_was_ok) {
29 bool handled = true;
30 IPC_BEGIN_MESSAGE_MAP_EX(ProfilerMessageFilter, message, *message_was_ok)
31 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ChildProfilerData,
32 OnChildProfilerData)
33 IPC_MESSAGE_UNHANDLED(handled = false)
34 IPC_END_MESSAGE_MAP_EX()
35 return handled;
36 }
37
38 void ProfilerMessageFilter::OnChildProfilerData(
39 int sequence_number,
40 const base::DictionaryValue& profiler_data) {
41 base::DictionaryValue* dictionary_value = new base::DictionaryValue;
42 dictionary_value->MergeDictionary(&profiler_data);
43 // OnProfilerDataCollected assumes the ownership of profiler_data.
44 content::ProfilerControllerImpl::GetInstance()->OnProfilerDataCollected(
45 sequence_number, dictionary_value);
46 }
OLDNEW
« no previous file with comments | « content/browser/profiler_message_filter.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698