OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/lazy_instance.h" | 6 #include "base/lazy_instance.h" |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
9 #include "base/trace_event/trace_event_impl.h" | 9 #include "base/trace_event/trace_event_impl.h" |
10 #include "content/browser/tracing/power_tracing_agent.h" | 10 #include "content/browser/tracing/power_tracing_agent.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 base::Bind(&PowerTracingAgent::StartAgentTracingOnIOThread, | 62 base::Bind(&PowerTracingAgent::StartAgentTracingOnIOThread, |
63 base::Unretained(this), path, callback)); | 63 base::Unretained(this), path, callback)); |
64 } | 64 } |
65 | 65 |
66 void PowerTracingAgent::StartAgentTracingOnIOThread( | 66 void PowerTracingAgent::StartAgentTracingOnIOThread( |
67 const std::string& path, | 67 const std::string& path, |
68 const StartAgentTracingCallback& callback) { | 68 const StartAgentTracingCallback& callback) { |
69 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 69 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
70 | 70 |
71 battor_agent_.reset(new battor::BattOrAgent( | 71 battor_agent_.reset(new battor::BattOrAgent( |
72 path, this, BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 72 path, this, BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))); |
73 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))); | |
74 | 73 |
75 start_tracing_callback_ = callback; | 74 start_tracing_callback_ = callback; |
76 battor_agent_->StartTracing(); | 75 battor_agent_->StartTracing(); |
77 } | 76 } |
78 | 77 |
79 void PowerTracingAgent::OnStartTracingComplete(battor::BattOrError error) { | 78 void PowerTracingAgent::OnStartTracingComplete(battor::BattOrError error) { |
80 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 79 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
81 | 80 |
82 bool success = (error == battor::BATTOR_ERROR_NONE); | 81 bool success = (error == battor::BATTOR_ERROR_NONE); |
83 if (!success) | 82 if (!success) |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 bool PowerTracingAgent::SupportsExplicitClockSync() { | 179 bool PowerTracingAgent::SupportsExplicitClockSync() { |
181 return battor_agent_->SupportsExplicitClockSync(); | 180 return battor_agent_->SupportsExplicitClockSync(); |
182 } | 181 } |
183 | 182 |
184 void PowerTracingAgent::OnGetFirmwareGitHashComplete( | 183 void PowerTracingAgent::OnGetFirmwareGitHashComplete( |
185 const std::string& version, battor::BattOrError error) { | 184 const std::string& version, battor::BattOrError error) { |
186 return; | 185 return; |
187 } | 186 } |
188 | 187 |
189 } // namespace content | 188 } // namespace content |
OLD | NEW |