| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_PROFILING_MEMLOG_STREAM_RECEIVER_H_ |
| 6 #define CHROME_PROFILING_MEMLOG_STREAM_RECEIVER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 |
| 13 namespace profiling { |
| 14 |
| 15 // A stream receiver is a sink for unparsed bytes. See also LogReceiver. |
| 16 class MemlogStreamReceiver |
| 17 : public base::RefCountedThreadSafe<MemlogStreamReceiver> { |
| 18 public: |
| 19 MemlogStreamReceiver() {} |
| 20 virtual ~MemlogStreamReceiver() {} |
| 21 |
| 22 // Returns true on success, false on unrecoverable error (in which case no |
| 23 // more blocks will be sent). May take a ref to the block, so the caller |
| 24 // should not modify it later. |
| 25 virtual void OnStreamData(std::unique_ptr<char[]> data, size_t sz) = 0; |
| 26 |
| 27 virtual void OnStreamComplete() = 0; |
| 28 }; |
| 29 |
| 30 } // namespace profiling |
| 31 |
| 32 #endif // CHROME_PROFILING_MEMLOG_STREAM_RECEIVER_H_ |
| OLD | NEW |