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

Side by Side Diff: content/common/child_process_host.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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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/common/child_process_host.h" 5 #include "content/common/child_process_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/process_util.h" 12 #include "base/process_util.h"
13 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 13 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
14 #include "base/tracked_objects.h"
14 #include "content/common/child_process_info.h" 15 #include "content/common/child_process_info.h"
15 #include "content/common/child_process_messages.h" 16 #include "content/common/child_process_messages.h"
16 #include "content/public/common/content_paths.h" 17 #include "content/public/common/content_paths.h"
17 #include "content/public/common/content_switches.h" 18 #include "content/public/common/content_switches.h"
18 #include "ipc/ipc_logging.h" 19 #include "ipc/ipc_logging.h"
19 20
20 #if defined(OS_LINUX) 21 #if defined(OS_LINUX)
21 #include "base/linux_util.h" 22 #include "base/linux_util.h"
22 #endif // OS_LINUX 23 #endif // OS_LINUX
23 24
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 279
279 for (size_t i = 0; i < filters_.size(); ++i) 280 for (size_t i = 0; i < filters_.size(); ++i)
280 filters_[i]->OnFilterAdded(channel_.get()); 281 filters_[i]->OnFilterAdded(channel_.get());
281 282
282 // Make sure these messages get sent first. 283 // Make sure these messages get sent first.
283 #if defined(IPC_MESSAGE_LOG_ENABLED) 284 #if defined(IPC_MESSAGE_LOG_ENABLED)
284 bool enabled = IPC::Logging::GetInstance()->Enabled(); 285 bool enabled = IPC::Logging::GetInstance()->Enabled();
285 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); 286 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled));
286 #endif 287 #endif
287 288
289 bool enable = tracked_objects::ThreadData::tracking_status();
jam 2011/11/28 15:17:34 instead of having this code here and in RenderProc
ramant (doing other things) 2011/11/29 01:32:20 Done.
290 Send(new ChildProcessMsg_SetProfilerStatus(enable));
291
288 Send(new ChildProcessMsg_AskBeforeShutdown()); 292 Send(new ChildProcessMsg_AskBeforeShutdown());
289 293
290 opening_channel_ = true; 294 opening_channel_ = true;
291 295
292 return true; 296 return true;
293 } 297 }
294 298
295 bool ChildProcessHost::OnMessageReceived(const IPC::Message& msg) { 299 bool ChildProcessHost::OnMessageReceived(const IPC::Message& msg) {
296 return false; 300 return false;
297 } 301 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 uint32 buffer_size, 428 uint32 buffer_size,
425 base::SharedMemoryHandle* handle) { 429 base::SharedMemoryHandle* handle) {
426 ChildProcessHost::OnAllocateSharedMemory( 430 ChildProcessHost::OnAllocateSharedMemory(
427 buffer_size, peer_handle_, handle); 431 buffer_size, peer_handle_, handle);
428 } 432 }
429 433
430 void ChildProcessHost::ListenerHook::OnShutdownRequest() { 434 void ChildProcessHost::ListenerHook::OnShutdownRequest() {
431 if (host_->CanShutdown()) 435 if (host_->CanShutdown())
432 host_->Send(new ChildProcessMsg_Shutdown()); 436 host_->Send(new ChildProcessMsg_Shutdown());
433 } 437 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698