OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/tracing/trace_controller_impl.h" | 5 #include "content/browser/tracing/trace_controller_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 public: | 27 public: |
28 AutoStopTraceSubscriberStdio(const base::FilePath& file_path) | 28 AutoStopTraceSubscriberStdio(const base::FilePath& file_path) |
29 : TraceSubscriberStdio(file_path) {} | 29 : TraceSubscriberStdio(file_path) {} |
30 | 30 |
31 static void EndStartupTrace(TraceSubscriberStdio* subscriber) { | 31 static void EndStartupTrace(TraceSubscriberStdio* subscriber) { |
32 if (!TraceControllerImpl::GetInstance()->EndTracingAsync(subscriber)) | 32 if (!TraceControllerImpl::GetInstance()->EndTracingAsync(subscriber)) |
33 delete subscriber; | 33 delete subscriber; |
34 // else, the tracing will end asynchronously in OnEndTracingComplete(). | 34 // else, the tracing will end asynchronously in OnEndTracingComplete(). |
35 } | 35 } |
36 | 36 |
37 virtual void OnEndTracingComplete() { | 37 virtual void OnEndTracingComplete() OVERRIDE { |
38 TraceSubscriberStdio::OnEndTracingComplete(); | 38 TraceSubscriberStdio::OnEndTracingComplete(); |
39 delete this; | 39 delete this; |
40 // TODO(joth): this would be the time to automatically open up | 40 // TODO(joth): this would be the time to automatically open up |
41 // chrome://tracing/ and load up the trace data collected. | 41 // chrome://tracing/ and load up the trace data collected. |
42 } | 42 } |
43 }; | 43 }; |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 TraceController* TraceController::GetInstance() { | 47 TraceController* TraceController::GetInstance() { |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 // The last ack represents local trace, so we need to ack it now. Note that | 405 // The last ack represents local trace, so we need to ack it now. Note that |
406 // this code only executes if there were child processes. | 406 // this code only executes if there were child processes. |
407 float bpf = TraceLog::GetInstance()->GetBufferPercentFull(); | 407 float bpf = TraceLog::GetInstance()->GetBufferPercentFull(); |
408 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 408 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
409 base::Bind(&TraceControllerImpl::OnTraceBufferPercentFullReply, | 409 base::Bind(&TraceControllerImpl::OnTraceBufferPercentFullReply, |
410 base::Unretained(this), bpf)); | 410 base::Unretained(this), bpf)); |
411 } | 411 } |
412 } | 412 } |
413 | 413 |
414 } // namespace content | 414 } // namespace content |
OLD | NEW |