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

Side by Side Diff: content/browser/devtools/protocol/io_handler.h

Issue 2590293003: [DevTools] Rework DevToolsSession interaction with domain handlers. (Closed)
Patch Set: addressed comments Created 3 years, 12 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
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 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_IO_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_IO_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_IO_HANDLER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_IO_HANDLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "content/browser/devtools/protocol/devtools_domain_handler.h"
10 #include "content/browser/devtools/protocol/io.h" 11 #include "content/browser/devtools/protocol/io.h"
11 12
12 namespace base { 13 namespace base {
13 class RefCountedString; 14 class RefCountedString;
14 } 15 }
15 16
16 namespace content { 17 namespace content {
17 class DevToolsIOContext; 18 class DevToolsIOContext;
18 19
19 namespace protocol { 20 namespace protocol {
20 21
21 class IOHandler : public IO::Backend { 22 class IOHandler : public DevToolsDomainHandler,
23 public IO::Backend {
22 public: 24 public:
23 explicit IOHandler(DevToolsIOContext* io_context); 25 explicit IOHandler(DevToolsIOContext* io_context);
24 ~IOHandler() override; 26 ~IOHandler() override;
25 27
26 void Wire(UberDispatcher*); 28 void Wire(UberDispatcher* dispatcher) override;
29 void SetRenderFrameHost(RenderFrameHostImpl* host) override;
27 Response Disable() override; 30 Response Disable() override;
28 31
29 // Protocol methods. 32 // Protocol methods.
30 void Read( 33 void Read(
31 const std::string& handle, 34 const std::string& handle,
32 Maybe<int> offset, 35 Maybe<int> offset,
33 Maybe<int> max_size, 36 Maybe<int> max_size,
34 std::unique_ptr<ReadCallback> callback) override; 37 std::unique_ptr<ReadCallback> callback) override;
35 Response Close(const std::string& handle) override; 38 Response Close(const std::string& handle) override;
36 39
37 private: 40 private:
38 void ReadComplete(std::unique_ptr<ReadCallback> callback, 41 void ReadComplete(std::unique_ptr<ReadCallback> callback,
39 const scoped_refptr<base::RefCountedString>& data, int status); 42 const scoped_refptr<base::RefCountedString>& data, int status);
40 43
41 std::unique_ptr<IO::Frontend> frontend_; 44 std::unique_ptr<IO::Frontend> frontend_;
42 DevToolsIOContext* io_context_; 45 DevToolsIOContext* io_context_;
43 base::WeakPtrFactory<IOHandler> weak_factory_; 46 base::WeakPtrFactory<IOHandler> weak_factory_;
44 47
45 DISALLOW_COPY_AND_ASSIGN(IOHandler); 48 DISALLOW_COPY_AND_ASSIGN(IOHandler);
46 }; 49 };
47 50
48 } // namespace protocol 51 } // namespace protocol
49 } // namespace content 52 } // namespace content
50 53
51 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ 54 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698