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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_IO_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_IO_HANDLER_H_
8 #include "base/memory/weak_ptr.h"
9 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
12 class RefCountedString
;
17 class DevToolsIOContext
;
23 using Response
= DevToolsProtocolClient::Response
;
25 explicit IOHandler(DevToolsIOContext
* io_context
);
28 void SetClient(scoped_ptr
<Client
> client
);
31 Response
Read(DevToolsCommandId command_id
, const std::string
& handle
,
32 const int* offset
, const int* max_size
);
33 Response
Close(const std::string
& handle
);
36 void ReadComplete(DevToolsCommandId command_id
,
37 const scoped_refptr
<base::RefCountedString
>& data
, int status
);
39 scoped_ptr
<Client
> client_
;
40 DevToolsIOContext
* io_context_
;
41 base::WeakPtrFactory
<IOHandler
> weak_factory_
;
43 DISALLOW_COPY_AND_ASSIGN(IOHandler
);
47 } // namespace devtools
48 } // namespace content
50 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_