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

Unified Diff: content/common/child_thread.cc

Issue 8588023: Collect profiler stats from browser child processes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/child_thread.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/child_thread.cc
===================================================================
--- content/common/child_thread.cc (revision 112492)
+++ content/common/child_thread.cc (working copy)
@@ -4,9 +4,12 @@
#include "content/common/child_thread.h"
+#include "base/command_line.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 +186,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 +224,22 @@
}
#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());
+
+ Send(new ChildProcessHostMsg_ChildProfilerData(
+ sequence_number, *value.get()));
+}
+
void ChildThread::OnDumpHandles() {
#if defined(OS_WIN)
scoped_refptr<content::HandleEnumerator> handle_enum(
« no previous file with comments | « content/common/child_thread.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698