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

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

Issue 2867073006: Adds a /json/protocol endpoint to serve the DevTools protocol (Closed)
Patch Set: try a different dependancy Created 3 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_DEVTOOLS_HTTP_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 const std::string& message); 91 const std::string& message);
92 void Send200(int connection_id, 92 void Send200(int connection_id,
93 const std::string& data, 93 const std::string& data,
94 const std::string& mime_type); 94 const std::string& mime_type);
95 void Send404(int connection_id); 95 void Send404(int connection_id);
96 void Send500(int connection_id, 96 void Send500(int connection_id,
97 const std::string& message); 97 const std::string& message);
98 void AcceptWebSocket(int connection_id, 98 void AcceptWebSocket(int connection_id,
99 const net::HttpServerRequestInfo& request); 99 const net::HttpServerRequestInfo& request);
100 100
101 void DecompressAndSendJsonProtocol(int connection_id);
102
101 // Returns the front end url without the host at the beginning. 103 // Returns the front end url without the host at the beginning.
102 std::string GetFrontendURLInternal(const std::string& target_id, 104 std::string GetFrontendURLInternal(const std::string& target_id,
103 const std::string& host); 105 const std::string& host);
104 106
105 std::unique_ptr<base::DictionaryValue> SerializeDescriptor( 107 std::unique_ptr<base::DictionaryValue> SerializeDescriptor(
106 scoped_refptr<DevToolsAgentHost> agent_host, 108 scoped_refptr<DevToolsAgentHost> agent_host,
107 const std::string& host); 109 const std::string& host);
108 110
109 // The thread used by the devtools handler to run server socket. 111 // The thread used by the devtools handler to run server socket.
110 base::Thread* thread_; 112 base::Thread* thread_;
111 std::string frontend_url_; 113 std::string frontend_url_;
112 std::string product_name_; 114 std::string product_name_;
113 std::string user_agent_; 115 std::string user_agent_;
114 ServerWrapper* server_wrapper_; 116 ServerWrapper* server_wrapper_;
115 std::unique_ptr<net::IPEndPoint> server_ip_address_; 117 std::unique_ptr<net::IPEndPoint> server_ip_address_;
116 using ConnectionToClientMap = 118 using ConnectionToClientMap =
117 std::map<int, std::unique_ptr<DevToolsAgentHostClientImpl>>; 119 std::map<int, std::unique_ptr<DevToolsAgentHostClientImpl>>;
118 ConnectionToClientMap connection_to_client_; 120 ConnectionToClientMap connection_to_client_;
119 DevToolsManagerDelegate* delegate_; 121 DevToolsManagerDelegate* delegate_;
120 DevToolsSocketFactory* socket_factory_; 122 DevToolsSocketFactory* socket_factory_;
121 base::WeakPtrFactory<DevToolsHttpHandler> weak_factory_; 123 base::WeakPtrFactory<DevToolsHttpHandler> weak_factory_;
122 124
123 DISALLOW_COPY_AND_ASSIGN(DevToolsHttpHandler); 125 DISALLOW_COPY_AND_ASSIGN(DevToolsHttpHandler);
124 }; 126 };
125 127
126 } // namespace content 128 } // namespace content
127 129
128 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_ 130 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698