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

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

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
« no previous file with comments | « no previous file | tools/battor_agent/battor_agent.cc » ('j') | tools/battor_agent/battor_agent.cc » ('J')
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 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/callback_forward.h"
7 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
8 10
9 namespace battor { 11 namespace battor {
10 12
11 class BattOrAgent { 13 class BattOrAgent {
12 public: 14 public:
13 explicit BattOrAgent(const std::string& path); 15 explicit BattOrAgent(const std::string& path);
14 virtual ~BattOrAgent(); 16 virtual ~BattOrAgent();
15 17
16 // Tells the BattOr to start tracing. 18 // Tells the BattOr (using a best-effort signal) to start tracing.
17 void StartTracing(); 19 void StartTracing();
18 20
19 // Tells the BattOr to stop tracing and returns the trace contents. 21 // Tells the BattOr to stop tracing and calls the callback when the
20 void StopTracing(std::string* out_trace); 22 // trace output is available.
23 void StopTracing(
24 const base::Callback<void(scoped_ptr<std::string>)>& callback);
21 25
22 // Tells the BattOr to record a clock sync marker in its own trace log. 26 // Tells the BattOr (using a best-effort signal) to record a clock
27 // sync marker in its own trace log.
23 void RecordClockSyncMarker(const std::string& marker); 28 void RecordClockSyncMarker(const std::string& marker);
Zhen Wang 2015/10/29 19:40:22 I think we still need asynchronous call for this b
24 29
25 // Tells the BattOr to issue clock sync markers to all other tracing 30 // Tells the BattOr (using a best-effort signal) to issue clock sync
26 // agents that it's connected to. 31 // markers to all other tracing agents that it's connected to.
27 void IssueClockSyncMarker(); 32 void IssueClockSyncMarker();
28 33
29 // Returns whether the BattOr is able to record clock sync markers 34 // Returns whether the BattOr is able to record clock sync markers
30 // in its own trace log. 35 // in its own trace log.
31 static bool SupportsExplicitClockSync() { return true; } 36 static bool SupportsExplicitClockSync() { return true; }
32 37
33 private: 38 private:
34 std::string path_; 39 std::string path_;
35 40
36 DISALLOW_COPY_AND_ASSIGN(BattOrAgent); 41 DISALLOW_COPY_AND_ASSIGN(BattOrAgent);
37 }; 42 };
38 43
39 } // namespace battor 44 } // namespace battor
OLDNEW
« no previous file with comments | « no previous file | tools/battor_agent/battor_agent.cc » ('j') | tools/battor_agent/battor_agent.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698