1 // Copyright 2014 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_DEVTOOLS_PROTOCOL_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_H_
8 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
12 class DevToolsProtocolHandler
{
14 using Response
= DevToolsProtocolClient::Response
;
15 using Notifier
= base::Callback
<void(const std::string
& message
)>;
17 explicit DevToolsProtocolHandler(const Notifier
& notifier
);
18 virtual ~DevToolsProtocolHandler();
20 scoped_ptr
<base::DictionaryValue
> ParseCommand(const std::string
& message
);
21 void HandleCommand(scoped_ptr
<base::DictionaryValue
> command
);
22 bool HandleOptionalCommand(scoped_ptr
<base::DictionaryValue
> command
);
24 DevToolsProtocolDispatcher
* dispatcher() { return &dispatcher_
; }
27 DevToolsProtocolClient client_
;
28 DevToolsProtocolDispatcher dispatcher_
;
31 } // namespace content
33 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_H_