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

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

Issue 12319114: Extract debugger target enumeration into a separate class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@debugger
Patch Set: Cleaner version ready for review Created 7 years, 9 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_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_IMPL_H_
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_IMPL_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 23 matching lines...) Expand all
34 34
35 class DevToolsBrowserTarget; 35 class DevToolsBrowserTarget;
36 class DevToolsClientHost; 36 class DevToolsClientHost;
37 37
38 class DevToolsHttpHandlerImpl 38 class DevToolsHttpHandlerImpl
39 : public DevToolsHttpHandler, 39 : public DevToolsHttpHandler,
40 public NotificationObserver, 40 public NotificationObserver,
41 public base::RefCountedThreadSafe<DevToolsHttpHandlerImpl>, 41 public base::RefCountedThreadSafe<DevToolsHttpHandlerImpl>,
42 public net::HttpServer::Delegate { 42 public net::HttpServer::Delegate {
43 private: 43 private:
44 struct PageInfo; 44 typedef std::vector<DevToolsAgentHost*> PageList;
pfeldman 2013/03/01 08:49:30 Vector of serialized value types was Ok, but now y
Vladislav Kaznacheev 2013/03/01 12:58:35 Inlined all manipulations with this list at the si
45 typedef std::vector<PageInfo> PageList;
46 friend class base::RefCountedThreadSafe<DevToolsHttpHandlerImpl>; 45 friend class base::RefCountedThreadSafe<DevToolsHttpHandlerImpl>;
47 friend class DevToolsHttpHandler; 46 friend class DevToolsHttpHandler;
48 47
49 static bool SortPageListByTime(const PageInfo& info1, const PageInfo& info2); 48 static bool SortPageListByTime(DevToolsAgentHost* agent_host1,
pfeldman 2013/03/01 08:49:30 Since you are touching it - TimeComparator
Vladislav Kaznacheev 2013/03/01 12:58:35 Done.
49 DevToolsAgentHost* agent_host2);
50 50
51 // Takes ownership over |socket_factory|. 51 // Takes ownership over |socket_factory|.
52 DevToolsHttpHandlerImpl(const net::StreamListenSocketFactory* socket_factory, 52 DevToolsHttpHandlerImpl(const net::StreamListenSocketFactory* socket_factory,
53 const std::string& frontend_url, 53 const std::string& frontend_url,
54 DevToolsHttpHandlerDelegate* delegate); 54 DevToolsHttpHandlerDelegate* delegate);
55 virtual ~DevToolsHttpHandlerImpl(); 55 virtual ~DevToolsHttpHandlerImpl();
56 void Start(); 56 void Start();
57 57
58 // DevToolsHttpHandler implementation. 58 // DevToolsHttpHandler implementation.
59 virtual void Stop() OVERRIDE; 59 virtual void Stop() OVERRIDE;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 const std::string& message); 109 const std::string& message);
110 void AcceptWebSocket(int connection_id, 110 void AcceptWebSocket(int connection_id,
111 const net::HttpServerRequestInfo& request); 111 const net::HttpServerRequestInfo& request);
112 112
113 PageList GeneratePageList(); 113 PageList GeneratePageList();
114 114
115 // Returns the front end url without the host at the beginning. 115 // Returns the front end url without the host at the beginning.
116 std::string GetFrontendURLInternal(const std::string rvh_id, 116 std::string GetFrontendURLInternal(const std::string rvh_id,
117 const std::string& host); 117 const std::string& host);
118 118
119 PageInfo CreatePageInfo(RenderViewHost* rvh, 119 base::DictionaryValue* SerializePageInfo(DevToolsAgentHost* agent_host,
120 DevToolsHttpHandlerDelegate::TargetType type);
121
122 base::DictionaryValue* SerializePageInfo(const PageInfo& page_info,
123 const std::string& host); 120 const std::string& host);
124 121
125 // The thread used by the devtools handler to run server socket. 122 // The thread used by the devtools handler to run server socket.
126 scoped_ptr<base::Thread> thread_; 123 scoped_ptr<base::Thread> thread_;
127 124
128 std::string overridden_frontend_url_; 125 std::string overridden_frontend_url_;
129 scoped_ptr<const net::StreamListenSocketFactory> socket_factory_; 126 scoped_ptr<const net::StreamListenSocketFactory> socket_factory_;
130 scoped_refptr<net::HttpServer> server_; 127 scoped_refptr<net::HttpServer> server_;
131 typedef std::map<int, DevToolsClientHost*> ConnectionToClientHostMap; 128 typedef std::map<int, DevToolsClientHost*> ConnectionToClientHostMap;
132 ConnectionToClientHostMap connection_to_client_host_ui_; 129 ConnectionToClientHostMap connection_to_client_host_ui_;
133 scoped_ptr<DevToolsHttpHandlerDelegate> delegate_; 130 scoped_ptr<DevToolsHttpHandlerDelegate> delegate_;
134 DevToolsAgentHostBinding* binding_; 131 DevToolsAgentHostBinding* binding_;
135 scoped_ptr<DevToolsAgentHostBinding> default_binding_;
136 NotificationRegistrar registrar_; 132 NotificationRegistrar registrar_;
137 scoped_ptr<DevToolsBrowserTarget> browser_target_; 133 scoped_ptr<DevToolsBrowserTarget> browser_target_;
138 DISALLOW_COPY_AND_ASSIGN(DevToolsHttpHandlerImpl); 134 DISALLOW_COPY_AND_ASSIGN(DevToolsHttpHandlerImpl);
139 }; 135 };
140 136
141 } // namespace content 137 } // namespace content
142 138
143 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_IMPL_H_ 139 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698