| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/trace_controller.h" | 5 #include "content/browser/trace_controller.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" |
| 11 #include "content/browser/browser_message_filter.h" | |
| 12 #include "content/browser/trace_message_filter.h" | 11 #include "content/browser/trace_message_filter.h" |
| 13 #include "content/browser/trace_subscriber_stdio.h" | 12 #include "content/browser/trace_subscriber_stdio.h" |
| 14 #include "content/common/child_process_messages.h" | 13 #include "content/common/child_process_messages.h" |
| 14 #include "content/public/browser/browser_message_filter.h" |
| 15 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
| 16 | 16 |
| 17 using base::debug::TraceLog; | 17 using base::debug::TraceLog; |
| 18 using content::BrowserMessageFilter; |
| 18 using content::BrowserThread; | 19 using content::BrowserThread; |
| 19 | 20 |
| 20 namespace { | 21 namespace { |
| 21 | 22 |
| 22 class AutoStopTraceSubscriberStdio : public TraceSubscriberStdio { | 23 class AutoStopTraceSubscriberStdio : public TraceSubscriberStdio { |
| 23 public: | 24 public: |
| 24 AutoStopTraceSubscriberStdio(const FilePath& file_path) | 25 AutoStopTraceSubscriberStdio(const FilePath& file_path) |
| 25 : TraceSubscriberStdio(file_path) {} | 26 : TraceSubscriberStdio(file_path) {} |
| 26 | 27 |
| 27 static void EndStartupTrace(TraceSubscriberStdio* subscriber) { | 28 static void EndStartupTrace(TraceSubscriberStdio* subscriber) { |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 if (pending_bpf_ack_count_ == 1) { | 366 if (pending_bpf_ack_count_ == 1) { |
| 366 // The last ack represents local trace, so we need to ack it now. Note that | 367 // The last ack represents local trace, so we need to ack it now. Note that |
| 367 // this code only executes if there were child processes. | 368 // this code only executes if there were child processes. |
| 368 float bpf = TraceLog::GetInstance()->GetBufferPercentFull(); | 369 float bpf = TraceLog::GetInstance()->GetBufferPercentFull(); |
| 369 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 370 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 370 base::Bind(&TraceController::OnTraceBufferPercentFullReply, | 371 base::Bind(&TraceController::OnTraceBufferPercentFullReply, |
| 371 base::Unretained(this), bpf)); | 372 base::Unretained(this), bpf)); |
| 372 } | 373 } |
| 373 } | 374 } |
| 374 | 375 |
| OLD | NEW |