Index: content/browser/tracing/tracing_controller_impl.cc |
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc |
index 1622819b04d21abeb2eb3af9fad223cd07e92375..d80dc782c696e7e6f4887d0b5ee60a1956fc1d5f 100644 |
--- a/content/browser/tracing/tracing_controller_impl.cc |
+++ b/content/browser/tracing/tracing_controller_impl.cc |
@@ -175,6 +175,7 @@ TracingControllerImpl::TracingControllerImpl() |
#endif |
is_recording_(TraceLog::GetInstance()->IsEnabled()), |
is_monitoring_(false) { |
+ base::trace_event::MemoryDumpManager::GetInstance()->SetDelegate(this); |
} |
TracingControllerImpl::~TracingControllerImpl() { |
@@ -879,6 +880,43 @@ void TracingControllerImpl::UnregisterTracingUI(TracingUI* tracing_ui) { |
tracing_uis_.erase(it); |
} |
+void TracingControllerImpl::RequestGlobalMemoryDump( |
+ const base::trace_event::MemoryDumpRequestArgs& args, |
+ const base::trace_event::MemoryDumpCallback& callback) { |
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
+ BrowserThread::PostTask( |
+ BrowserThread::UI, FROM_HERE, |
+ base::Bind(&TracingControllerImpl::RequestGlobalMemoryDump, |
+ base::Unretained(this), args, callback)); |
+ return; |
+ } |
+ // TODO(primiano): send a local dump request to each of the child processes |
+ // and do the bookkeping to keep track of the outstanding requests. |
Sami
2015/03/31 14:54:36
s/bookkeping/bookkeeping/
Primiano Tucci (use gerrit)
2015/04/01 11:05:41
Done.
|
+ // Also, at this point, this should check for collisions and bail out if a |
+ // global dump is requested while another is already in progress. |
+ NOTIMPLEMENTED(); |
+} |
+ |
+void TracingControllerImpl::OnProcessMemoryDumpResponse( |
+ TraceMessageFilter* trace_message_filter, |
+ uint64 dump_guid, |
+ bool success) { |
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
+ BrowserThread::PostTask( |
+ BrowserThread::UI, FROM_HERE, |
+ base::Bind(&TracingControllerImpl::OnProcessMemoryDumpResponse, |
+ base::Unretained(this), |
+ make_scoped_refptr(trace_message_filter), dump_guid, |
+ success)); |
+ return; |
+ } |
+ // TODO(primiano): update the bookkeping structs and, if this was the response |
Sami
2015/03/31 14:54:36
s/bookkeping/bookkeeping/
Primiano Tucci (use gerrit)
2015/04/01 11:05:41
Done.
|
+ // from the last pending child, fire the completion callback, which in turn |
+ // will cause a GlobalMemoryDumpResponse message to be sent back to the child, |
+ // if this global dump was NOT initiated by the browser. |
+ NOTIMPLEMENTED(); |
+} |
+ |
void TracingControllerImpl::OnMonitoringStateChanged(bool is_monitoring) { |
if (is_monitoring_ == is_monitoring) |
return; |