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

Side by Side Diff: content/browser/debugger/devtools_http_handler_impl.h

Issue 10169043: Allow customization of remote debugger URL targets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/debugger/devtools_http_handler_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_DEBUGGER_DEVTOOLS_HTTP_HANDLER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_HANDLER_IMPL_H_
6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_HANDLER_IMPL_H_ 6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_HANDLER_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "content/common/content_export.h" 16 #include "content/common/content_export.h"
17 #include "content/public/browser/devtools_http_handler.h" 17 #include "content/public/browser/devtools_http_handler.h"
18 #include "content/public/browser/devtools_http_handler_delegate.h"
18 #include "net/server/http_server.h" 19 #include "net/server/http_server.h"
19 #include "net/url_request/url_request.h" 20 #include "net/url_request/url_request.h"
20 21
21 namespace net { 22 namespace net {
22 class URLRequestContextGetter; 23 class URLRequestContextGetter;
23 } 24 }
24 25
25 namespace content { 26 namespace content {
26 27
27 class DevToolsClientHost; 28 class DevToolsClientHost;
(...skipping 15 matching lines...) Expand all
43 DevToolsHttpHandlerImpl(const std::string& ip, 44 DevToolsHttpHandlerImpl(const std::string& ip,
44 int port, 45 int port,
45 const std::string& frontend_url, 46 const std::string& frontend_url,
46 net::URLRequestContextGetter* request_context_getter, 47 net::URLRequestContextGetter* request_context_getter,
47 DevToolsHttpHandlerDelegate* delegate); 48 DevToolsHttpHandlerDelegate* delegate);
48 virtual ~DevToolsHttpHandlerImpl(); 49 virtual ~DevToolsHttpHandlerImpl();
49 void Start(); 50 void Start();
50 51
51 // DevToolsHttpHandler implementation. 52 // DevToolsHttpHandler implementation.
52 virtual void Stop() OVERRIDE; 53 virtual void Stop() OVERRIDE;
54 virtual void SetRenderViewHostBinding(
55 RenderViewHostBinding* binding) OVERRIDE;
53 56
54 // net::HttpServer::Delegate implementation. 57 // net::HttpServer::Delegate implementation.
55 virtual void OnHttpRequest(int connection_id, 58 virtual void OnHttpRequest(int connection_id,
56 const net::HttpServerRequestInfo& info) OVERRIDE; 59 const net::HttpServerRequestInfo& info) OVERRIDE;
57 virtual void OnWebSocketRequest( 60 virtual void OnWebSocketRequest(
58 int connection_id, 61 int connection_id,
59 const net::HttpServerRequestInfo& info) OVERRIDE; 62 const net::HttpServerRequestInfo& info) OVERRIDE;
60 virtual void OnWebSocketMessage(int connection_id, 63 virtual void OnWebSocketMessage(int connection_id,
61 const std::string& data) OVERRIDE; 64 const std::string& data) OVERRIDE;
62 virtual void OnClose(int connection_id) OVERRIDE; 65 virtual void OnClose(int connection_id) OVERRIDE;
(...skipping 19 matching lines...) Expand all
82 void RequestCompleted(net::URLRequest* request); 85 void RequestCompleted(net::URLRequest* request);
83 86
84 void Send200(int connection_id, 87 void Send200(int connection_id,
85 const std::string& data, 88 const std::string& data,
86 const std::string& mime_type = "text/html"); 89 const std::string& mime_type = "text/html");
87 void Send404(int connection_id); 90 void Send404(int connection_id);
88 void Send500(int connection_id, 91 void Send500(int connection_id,
89 const std::string& message); 92 const std::string& message);
90 void AcceptWebSocket(int connection_id, 93 void AcceptWebSocket(int connection_id,
91 const net::HttpServerRequestInfo& request); 94 const net::HttpServerRequestInfo& request);
92 size_t BindRenderViewHost(RenderViewHost* rvh);
93 RenderViewHost* GetBoundRenderViewHost(size_t id);
94 void ResetRenderViewHostBinding();
95 95
96 std::string ip_; 96 std::string ip_;
97 int port_; 97 int port_;
98 std::string overridden_frontend_url_; 98 std::string overridden_frontend_url_;
99 scoped_refptr<net::HttpServer> server_; 99 scoped_refptr<net::HttpServer> server_;
100 typedef std::map<net::URLRequest*, int> 100 typedef std::map<net::URLRequest*, int>
101 RequestToSocketMap; 101 RequestToSocketMap;
102 RequestToSocketMap request_to_connection_io_; 102 RequestToSocketMap request_to_connection_io_;
103 typedef std::map<int, std::set<net::URLRequest*> > 103 typedef std::map<int, std::set<net::URLRequest*> >
104 ConnectionToRequestsMap; 104 ConnectionToRequestsMap;
105 ConnectionToRequestsMap connection_to_requests_io_; 105 ConnectionToRequestsMap connection_to_requests_io_;
106 typedef std::map<net::URLRequest*, scoped_refptr<net::IOBuffer> > 106 typedef std::map<net::URLRequest*, scoped_refptr<net::IOBuffer> >
107 BuffersMap; 107 BuffersMap;
108 BuffersMap request_to_buffer_io_; 108 BuffersMap request_to_buffer_io_;
109 typedef std::map<int, content::DevToolsClientHost*> 109 typedef std::map<int, content::DevToolsClientHost*>
110 ConnectionToClientHostMap; 110 ConnectionToClientHostMap;
111 ConnectionToClientHostMap connection_to_client_host_ui_; 111 ConnectionToClientHostMap connection_to_client_host_ui_;
112 net::URLRequestContextGetter* request_context_getter_; 112 net::URLRequestContextGetter* request_context_getter_;
113 scoped_ptr<DevToolsHttpHandlerDelegate> delegate_; 113 scoped_ptr<DevToolsHttpHandlerDelegate> delegate_;
114 typedef std::pair<int, int> Target; 114 RenderViewHostBinding* binding_;
115 std::vector<Target> targets_; 115 scoped_ptr<RenderViewHostBinding> default_binding_;
116 DISALLOW_COPY_AND_ASSIGN(DevToolsHttpHandlerImpl); 116 DISALLOW_COPY_AND_ASSIGN(DevToolsHttpHandlerImpl);
117 }; 117 };
118 118
119 } // namespace content 119 } // namespace content
120 120
121 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_HANDLER_IMPL_H_ 121 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_HANDLER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/debugger/devtools_http_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698