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

Unified Diff: chrome/profiling/memlog_stream_receiver.h

Issue 2940003002: Add pipe implementation for OOP memory logging (Closed)
Patch Set: Comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/profiling/memlog_receiver_pipe_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/profiling/memlog_stream_receiver.h
diff --git a/chrome/profiling/memlog_stream_receiver.h b/chrome/profiling/memlog_stream_receiver.h
new file mode 100644
index 0000000000000000000000000000000000000000..ea8a6d63585ad0aefdb726c073b989d365465bae
--- /dev/null
+++ b/chrome/profiling/memlog_stream_receiver.h
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_PROFILING_MEMLOG_STREAM_RECEIVER_H_
+#define CHROME_PROFILING_MEMLOG_STREAM_RECEIVER_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+
+namespace profiling {
+
+// A stream receiver is a sink for unparsed bytes. See also LogReceiver.
+class MemlogStreamReceiver
+ : public base::RefCountedThreadSafe<MemlogStreamReceiver> {
+ public:
+ MemlogStreamReceiver() {}
+ virtual ~MemlogStreamReceiver() {}
+
+ // Returns true on success, false on unrecoverable error (in which case no
+ // more blocks will be sent). May take a ref to the block, so the caller
+ // should not modify it later.
+ virtual void OnStreamData(std::unique_ptr<char[]> data, size_t sz) = 0;
+
+ virtual void OnStreamComplete() = 0;
+};
+
+} // namespace profiling
+
+#endif // CHROME_PROFILING_MEMLOG_STREAM_RECEIVER_H_
« no previous file with comments | « chrome/profiling/memlog_receiver_pipe_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698