Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Side by Side Diff: tools/battor_agent/battor_agent.cc

Issue 2914173002: Removing file_thread_task_runner parameter from SerialIoHandler (Closed)
Patch Set: removed unused variable Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/battor_agent/battor_agent.h ('k') | tools/battor_agent/battor_agent_bin.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "tools/battor_agent/battor_agent.h" 4 #include "tools/battor_agent/battor_agent.h"
5 5
6 #include <iomanip> 6 #include <iomanip>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "tools/battor_agent/battor_connection_impl.h" 10 #include "tools/battor_agent/battor_connection_impl.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 samples->resize(remaining_bytes / sizeof(RawBattOrSample)); 101 samples->resize(remaining_bytes / sizeof(RawBattOrSample));
102 memcpy(samples->data(), frame_ptr, remaining_bytes); 102 memcpy(samples->data(), frame_ptr, remaining_bytes);
103 103
104 return true; 104 return true;
105 } 105 }
106 } // namespace 106 } // namespace
107 107
108 BattOrAgent::BattOrAgent( 108 BattOrAgent::BattOrAgent(
109 const std::string& path, 109 const std::string& path,
110 Listener* listener, 110 Listener* listener,
111 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner,
112 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner) 111 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner)
113 : connection_(new BattOrConnectionImpl(path, 112 : connection_(new BattOrConnectionImpl(path,
114 this, 113 this,
115 file_thread_task_runner,
116 ui_thread_task_runner)), 114 ui_thread_task_runner)),
117 listener_(listener), 115 listener_(listener),
118 last_action_(Action::INVALID), 116 last_action_(Action::INVALID),
119 command_(Command::INVALID), 117 command_(Command::INVALID),
120 num_command_attempts_(0) { 118 num_command_attempts_(0) {
121 // We don't care what thread the constructor is called on - we only care that 119 // We don't care what thread the constructor is called on - we only care that
122 // all of the other method invocations happen on the same thread. 120 // all of the other method invocations happen on the same thread.
123 thread_checker_.DetachFromThread(); 121 thread_checker_.DetachFromThread();
124 } 122 }
125 123
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 619
622 void BattOrAgent::SetActionTimeout(uint16_t timeout_seconds) { 620 void BattOrAgent::SetActionTimeout(uint16_t timeout_seconds) {
623 timeout_callback_.Reset( 621 timeout_callback_.Reset(
624 base::Bind(&BattOrAgent::OnActionTimeout, AsWeakPtr())); 622 base::Bind(&BattOrAgent::OnActionTimeout, AsWeakPtr()));
625 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 623 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
626 FROM_HERE, timeout_callback_.callback(), 624 FROM_HERE, timeout_callback_.callback(),
627 base::TimeDelta::FromSeconds(timeout_seconds)); 625 base::TimeDelta::FromSeconds(timeout_seconds));
628 } 626 }
629 627
630 } // namespace battor 628 } // namespace battor
OLDNEW
« no previous file with comments | « tools/battor_agent/battor_agent.h ('k') | tools/battor_agent/battor_agent_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698