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

Side by Side Diff: content/browser/devtools/devtools_protocol_handler.h

Issue 1437993003: Revert of [DevTools] Filter any messages from previous sessions in DevToolsAgentHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 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 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_DEVTOOLS_PROTOCOL_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_H_
7 7
8 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" 8 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 class DevToolsAgentHost; 12 class DevToolsAgentHost;
13 class DevToolsAgentHostImpl;
14 class DevToolsProtocolDelegate;
15 13
16 class DevToolsProtocolHandler { 14 class DevToolsProtocolHandler {
17 public: 15 public:
18 using Response = DevToolsProtocolClient::Response; 16 using Response = DevToolsProtocolClient::Response;
17 using Notifier = base::Callback<void(const std::string& message)>;
19 18
20 explicit DevToolsProtocolHandler(DevToolsAgentHostImpl* agent_host); 19 DevToolsProtocolHandler(DevToolsAgentHost* agent_host,
20 const Notifier& notifier);
21 virtual ~DevToolsProtocolHandler(); 21 virtual ~DevToolsProtocolHandler();
22 22
23 void HandleMessage(int session_id, const std::string& message); 23 void HandleMessage(const std::string& message);
24 bool HandleOptionalMessage(int session_id, 24 bool HandleOptionalMessage(const std::string& message, int* call_id);
25 const std::string& message,
26 int* call_id);
27 25
28 DevToolsProtocolDispatcher* dispatcher() { return &dispatcher_; } 26 DevToolsProtocolDispatcher* dispatcher() { return &dispatcher_; }
29 27
30 private: 28 private:
31 scoped_ptr<base::DictionaryValue> ParseCommand(int session_id, 29 scoped_ptr<base::DictionaryValue> ParseCommand(const std::string& message);
32 const std::string& message); 30 bool PassCommandToDelegate(base::DictionaryValue* command);
33 bool PassCommandToDelegate(int session_id, base::DictionaryValue* command); 31 void HandleCommand(scoped_ptr<base::DictionaryValue> command);
34 void HandleCommand(int session_id, scoped_ptr<base::DictionaryValue> command); 32 bool HandleOptionalCommand(scoped_ptr<base::DictionaryValue> command,
35 bool HandleOptionalCommand(int session_id,
36 scoped_ptr<base::DictionaryValue> command,
37 int* call_id); 33 int* call_id);
38 34
39 DevToolsAgentHost* agent_host_; 35 DevToolsAgentHost* agent_host_;
40 DevToolsProtocolClient client_; 36 DevToolsProtocolClient client_;
41 DevToolsProtocolDispatcher dispatcher_; 37 DevToolsProtocolDispatcher dispatcher_;
42 }; 38 };
43 39
44 } // namespace content 40 } // namespace content
45 41
46 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_H_ 42 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_DEVTOOLS_PROTOCOL_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/devtools/devtools_agent_host_impl.cc ('k') | content/browser/devtools/devtools_protocol_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698