OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/tracing_controller_impl.h" | 5 #include "content/browser/tracing/tracing_controller_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
757 maximum_trace_buffer_percent_full_); | 757 maximum_trace_buffer_percent_full_); |
758 pending_trace_buffer_percent_full_callback_.Reset(); | 758 pending_trace_buffer_percent_full_callback_.Reset(); |
759 } | 759 } |
760 | 760 |
761 if (pending_trace_buffer_percent_full_ack_count_ == 1) { | 761 if (pending_trace_buffer_percent_full_ack_count_ == 1) { |
762 // The last ack represents local trace, so we need to ack it now. Note that | 762 // The last ack represents local trace, so we need to ack it now. Note that |
763 // this code only executes if there were child processes. | 763 // this code only executes if there were child processes. |
764 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 764 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
765 base::Bind(&TracingControllerImpl::OnTraceBufferPercentFullReply, | 765 base::Bind(&TracingControllerImpl::OnTraceBufferPercentFullReply, |
766 base::Unretained(this), | 766 base::Unretained(this), |
767 make_scoped_refptr(trace_message_filter), | 767 scoped_refptr<TraceMessageFilter>(), |
768 TraceLog::GetInstance()->GetBufferPercentFull())); | 768 TraceLog::GetInstance()->GetBufferPercentFull())); |
Xianzhu
2014/01/08 20:58:16
It seems that we could call TraceLog::GetInstance-
Marshall
2014/01/09 17:09:09
Done.
| |
769 } | 769 } |
770 } | 770 } |
771 | 771 |
772 void TracingControllerImpl::OnWatchEventMatched() { | 772 void TracingControllerImpl::OnWatchEventMatched() { |
773 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 773 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
774 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 774 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
775 base::Bind(&TracingControllerImpl::OnWatchEventMatched, | 775 base::Bind(&TracingControllerImpl::OnWatchEventMatched, |
776 base::Unretained(this))); | 776 base::Unretained(this))); |
777 return; | 777 return; |
778 } | 778 } |
779 | 779 |
780 if (!watch_event_callback_.is_null()) | 780 if (!watch_event_callback_.is_null()) |
781 watch_event_callback_.Run(); | 781 watch_event_callback_.Run(); |
782 } | 782 } |
783 | 783 |
784 } // namespace content | 784 } // namespace content |
OLD | NEW |