OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "content/browser/tracing/tracing_controller_impl.h" | 4 #include "content/browser/tracing/tracing_controller_impl.h" |
5 | 5 |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/cpu.h" | 7 #include "base/cpu.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 !pending_stop_tracing_filters_.erase(trace_message_filter)) { | 666 !pending_stop_tracing_filters_.erase(trace_message_filter)) { |
667 // The response from the specified message filter has already been received. | 667 // The response from the specified message filter has already been received. |
668 return; | 668 return; |
669 } | 669 } |
670 | 670 |
671 if (--pending_stop_tracing_ack_count_ == 1) { | 671 if (--pending_stop_tracing_ack_count_ == 1) { |
672 // All acks from subprocesses have been received. Now flush the local trace. | 672 // All acks from subprocesses have been received. Now flush the local trace. |
673 // During or after this call, our OnLocalTraceDataCollected will be | 673 // During or after this call, our OnLocalTraceDataCollected will be |
674 // called with the last of the local trace data. | 674 // called with the last of the local trace data. |
675 if (trace_data_sink_) { | 675 if (trace_data_sink_) { |
676 TraceLog::GetInstance()->Flush( | 676 TraceLog::GetInstance()->Flush( |
677 base::Bind(&TracingControllerImpl::OnLocalTraceDataCollected, | 677 base::Bind(&TracingControllerImpl::OnLocalTraceDataCollected, |
678 base::Unretained(this)), | 678 base::Unretained(this)), |
679 true); | 679 true); |
680 } else { | 680 } else { |
681 TraceLog::GetInstance()->CancelTracing( | 681 TraceLog::GetInstance()->CancelTracing( |
682 base::Bind(&TracingControllerImpl::OnLocalTraceDataCollected, | 682 base::Bind(&TracingControllerImpl::OnLocalTraceDataCollected, |
683 base::Unretained(this))); | 683 base::Unretained(this))); |
684 } | 684 } |
685 return; | 685 return; |
686 } | 686 } |
687 | 687 |
688 if (pending_stop_tracing_ack_count_ != 0) | 688 if (pending_stop_tracing_ack_count_ != 0) |
689 return; | 689 return; |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 // Schedule the next queued dump (if applicable). | 1116 // Schedule the next queued dump (if applicable). |
1117 if (!queued_memory_dump_requests_.empty()) { | 1117 if (!queued_memory_dump_requests_.empty()) { |
1118 BrowserThread::PostTask( | 1118 BrowserThread::PostTask( |
1119 BrowserThread::UI, FROM_HERE, | 1119 BrowserThread::UI, FROM_HERE, |
1120 base::Bind(&TracingControllerImpl::PerformNextQueuedGlobalMemoryDump, | 1120 base::Bind(&TracingControllerImpl::PerformNextQueuedGlobalMemoryDump, |
1121 base::Unretained(this))); | 1121 base::Unretained(this))); |
1122 } | 1122 } |
1123 } | 1123 } |
1124 | 1124 |
1125 } // namespace content | 1125 } // namespace content |
OLD | NEW |