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

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

Issue 1407033008: Makes the BattOrAgent asynchronous (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Makes some commands best-effort Created 5 years, 1 month 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
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 4
5 #include "tools/battor_agent/battor_agent.h" 5 #include "tools/battor_agent/battor_agent.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h"
11
9 namespace battor { 12 namespace battor {
10 13
11 BattOrAgent::BattOrAgent(const std::string& path) : path_(path) { 14 BattOrAgent::BattOrAgent(const std::string& path) : path_(path) {
12 // TODO: Open up a serial connection with the BattOr. 15 // TODO: Open up a serial connection with the BattOr.
13 } 16 }
14 17
15 BattOrAgent::~BattOrAgent() { 18 BattOrAgent::~BattOrAgent() {
16 // TODO: Close the serial connection with the BattOr. 19 // TODO: Close the serial connection with the BattOr.
17 } 20 }
18 21
19 void BattOrAgent::StartTracing() { 22 void BattOrAgent::StartTracing() {
20 // TODO: Tell the BattOr to start tracing. 23 // TODO: Tell the BattOr to start tracing.
21 } 24 }
22 25
23 void BattOrAgent::StopTracing(std::string* out_trace) { 26 void BattOrAgent::StopTracing(
27 const base::Callback<void(scoped_ptr<std::string>)>& callback) {
24 // TODO: Tell the BattOr to stop tracing. 28 // TODO: Tell the BattOr to stop tracing.
29 callback.Run(scoped_ptr<std::string>(new std::string("battor trace output")));
Zhen Wang 2015/10/29 19:40:22 I think this callback run eventually should be mov
charliea (OOO until 10-5) 2015/10/29 21:12:11 Yea. This callback will likely be sent in as the
25 } 30 }
26 31
27 void BattOrAgent::RecordClockSyncMarker(const std::string& marker) { 32 void BattOrAgent::RecordClockSyncMarker(const std::string& marker) {
28 // TODO: Tell the BattOr to record the specified clock sync marker. 33 // TODO: Tell the BattOr to record the specified clock sync marker.
29 } 34 }
30 35
31 void BattOrAgent::IssueClockSyncMarker() { 36 void BattOrAgent::IssueClockSyncMarker() {
32 // TODO: Tell atrace to issue a clock sync marker. 37 // TODO: Tell atrace to issue a clock sync marker.
33 } 38 }
34 39
35 } // namespace battor 40 } // namespace battor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698