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

Unified Diff: content/browser/devtools/protocol/io_handler.h

Issue 1307073002: DevTools: provide an option to return traces as streams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: work around MSVC compiler error due to missing Client definition Created 5 years, 4 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 | « content/browser/devtools/devtools_io_context.cc ('k') | content/browser/devtools/protocol/io_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol/io_handler.h
diff --git a/content/browser/devtools/protocol/io_handler.h b/content/browser/devtools/protocol/io_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..b52cfb9e86529f8abee12dbebccd38bc702885fb
--- /dev/null
+++ b/content/browser/devtools/protocol/io_handler.h
@@ -0,0 +1,51 @@
+// Copyright 2015 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 CONTENT_BROWSER_DEVTOOLS_PROTOCOL_IO_HANDLER_H_
+#define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_IO_HANDLER_H_
+
+#include "base/memory/weak_ptr.h"
+#include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
+
+namespace base {
+class RefCountedString;
+}
+
+namespace content {
+namespace devtools {
+class DevToolsIOContext;
+
+namespace io {
+
+class Client;
+
+class IOHandler {
+ public:
+ using Response = DevToolsProtocolClient::Response;
+
+ explicit IOHandler(DevToolsIOContext* io_context);
+ ~IOHandler();
+
+ void SetClient(const scoped_ptr<Client>& client);
+
+ // Protocol methods.
+ Response Read(DevToolsCommandId command_id, const std::string& handle,
+ const int* offset, const int* max_size);
+ Response Close(const std::string& handle);
+
+ private:
+ void ReadComplete(DevToolsCommandId command_id,
+ const scoped_refptr<base::RefCountedString>& data, int status);
+
+ DevToolsIOContext* io_context_;
+ base::WeakPtrFactory<IOHandler> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(IOHandler);
+};
+
+} // namespace io
+} // namespace devtools
+} // namespace content
+
+#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_
« no previous file with comments | « content/browser/devtools/devtools_io_context.cc ('k') | content/browser/devtools/protocol/io_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698