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

Side by Side Diff: sky/tools/debugger/trace_collector.h

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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 | « sky/tools/debugger/debugger.cc ('k') | sky/tools/tester/test_harness_impl.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef SKY_TOOLS_DEBUGGER_TRACE_COLLECTOR_H_ 5 #ifndef SKY_TOOLS_DEBUGGER_TRACE_COLLECTOR_H_
6 #define SKY_TOOLS_DEBUGGER_TRACE_COLLECTOR_H_ 6 #define SKY_TOOLS_DEBUGGER_TRACE_COLLECTOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "mojo/common/data_pipe_drainer.h" 11 #include "mojo/common/data_pipe_drainer.h"
12 12
13 namespace sky { 13 namespace sky {
14 namespace debugger { 14 namespace debugger {
15 15
16 class TraceCollector : public mojo::common::DataPipeDrainer::Client { 16 class TraceCollector : public mojo::common::DataPipeDrainer::Client {
17 public: 17 public:
18 typedef base::Callback<void(std::string)> TraceCallback; 18 typedef base::Callback<void(std::string)> TraceCallback;
19 19
20 explicit TraceCollector(mojo::ScopedDataPipeConsumerHandle source); 20 explicit TraceCollector(mojo::ScopedDataPipeConsumerHandle source);
21 ~TraceCollector(); 21 ~TraceCollector() override;
22 22
23 void GetTrace(TraceCallback callback); 23 void GetTrace(TraceCallback callback);
24 24
25 private: 25 private:
26 void OnDataAvailable(const void* data, size_t num_bytes) override; 26 void OnDataAvailable(const void* data, size_t num_bytes) override;
27 void OnDataComplete() override; 27 void OnDataComplete() override;
28 28
29 std::string GetTraceAsString(); 29 std::string GetTraceAsString();
30 30
31 mojo::common::DataPipeDrainer drainer_; 31 mojo::common::DataPipeDrainer drainer_;
32 std::vector<char> trace_; 32 std::vector<char> trace_;
33 bool is_complete_; 33 bool is_complete_;
34 TraceCallback callback_; 34 TraceCallback callback_;
35 }; 35 };
36 36
37 } // namespace debugger 37 } // namespace debugger
38 } // namespace sky 38 } // namespace sky
39 39
40 #endif // SKY_TOOLS_DEBUGGER_TRACE_COLLECTOR_H_ 40 #endif // SKY_TOOLS_DEBUGGER_TRACE_COLLECTOR_H_
OLDNEW
« no previous file with comments | « sky/tools/debugger/debugger.cc ('k') | sky/tools/tester/test_harness_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698