| Index: content/common/child_thread.cc
|
| ===================================================================
|
| --- content/common/child_thread.cc (revision 110669)
|
| +++ content/common/child_thread.cc (working copy)
|
| @@ -4,9 +4,14 @@
|
|
|
| #include "content/common/child_thread.h"
|
|
|
| +#include "base/bind.h"
|
| +#include "base/command_line.h"
|
| +#include "base/json/json_writer.h"
|
| #include "base/message_loop.h"
|
| +#include "base/process.h"
|
| +#include "base/process_util.h"
|
| #include "base/string_util.h"
|
| -#include "base/command_line.h"
|
| +#include "base/tracked_objects.h"
|
| #include "content/common/child_process.h"
|
| #include "content/common/child_process_messages.h"
|
| #include "content/common/child_trace_message_filter.h"
|
| @@ -183,6 +188,10 @@
|
| IPC_MESSAGE_HANDLER(ChildProcessMsg_SetIPCLoggingEnabled,
|
| OnSetIPCLoggingEnabled)
|
| #endif
|
| + IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus,
|
| + OnSetProfilerStatus)
|
| + IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData,
|
| + OnGetChildProfilerData)
|
| IPC_MESSAGE_HANDLER(ChildProcessMsg_DumpHandles, OnDumpHandles)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| @@ -217,6 +226,25 @@
|
| }
|
| #endif // IPC_MESSAGE_LOG_ENABLED
|
|
|
| +void ChildThread::OnSetProfilerStatus(bool enable) {
|
| + tracked_objects::ThreadData::InitializeAndSetTrackingStatus(enable);
|
| +}
|
| +
|
| +void ChildThread::OnGetChildProfilerData(
|
| + int sequence_number,
|
| + const std::string& process_type) {
|
| + scoped_ptr<base::DictionaryValue> value(
|
| + tracked_objects::ThreadData::ToValue());
|
| + value->SetString("process_type", process_type);
|
| + value->SetInteger("process_id", base::GetCurrentProcId());
|
| +
|
| + std::string pickled_profiler_data;
|
| + base::JSONWriter::Write(value.get(), false, &pickled_profiler_data);
|
| +
|
| + Send(new ChildProcessHostMsg_ChildProfilerData(
|
| + sequence_number, pickled_profiler_data));
|
| +}
|
| +
|
| void ChildThread::OnDumpHandles() {
|
| #if defined(OS_WIN)
|
| scoped_refptr<content::HandleEnumerator> handle_enum(
|
|
|