OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 5 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/common/net/url_request_context_getter.h" | 9 #include "chrome/common/net/url_request_context_getter.h" |
10 #include "chrome/common/render_messages_params.h" | 10 #include "chrome/common/render_messages_params.h" |
11 #include "content/browser/renderer_host/socket_stream_host.h" | 11 #include "content/browser/renderer_host/socket_stream_host.h" |
12 #include "content/common/socket_stream.h" | 12 #include "content/common/socket_stream.h" |
13 #include "content/common/socket_stream_messages.h" | 13 #include "content/common/socket_stream_messages.h" |
| 14 #include "content/common/resource_messages.h" |
14 #include "net/websockets/websocket_job.h" | 15 #include "net/websockets/websocket_job.h" |
15 #include "net/websockets/websocket_throttle.h" | 16 #include "net/websockets/websocket_throttle.h" |
16 | 17 |
17 SocketStreamDispatcherHost::SocketStreamDispatcherHost() { | 18 SocketStreamDispatcherHost::SocketStreamDispatcherHost() { |
18 net::WebSocketJob::EnsureInit(); | 19 net::WebSocketJob::EnsureInit(); |
19 } | 20 } |
20 | 21 |
21 SocketStreamDispatcherHost::~SocketStreamDispatcherHost() { | 22 SocketStreamDispatcherHost::~SocketStreamDispatcherHost() { |
22 // TODO(ukai): Implement IDMap::RemoveAll(). | 23 // TODO(ukai): Implement IDMap::RemoveAll(). |
23 for (IDMap<SocketStreamHost>::const_iterator iter(&hosts_); | 24 for (IDMap<SocketStreamHost>::const_iterator iter(&hosts_); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 148 } |
148 } | 149 } |
149 | 150 |
150 net::URLRequestContext* SocketStreamDispatcherHost::GetURLRequestContext() { | 151 net::URLRequestContext* SocketStreamDispatcherHost::GetURLRequestContext() { |
151 net::URLRequestContext* rv = NULL; | 152 net::URLRequestContext* rv = NULL; |
152 if (url_request_context_override_.get()) { | 153 if (url_request_context_override_.get()) { |
153 // TODO(jam): temporary code until Gears is taken out, then | 154 // TODO(jam): temporary code until Gears is taken out, then |
154 // GetRequestContext will take a different parameter and we can take out | 155 // GetRequestContext will take a different parameter and we can take out |
155 // this struct and the #include "chrome/common/render_messages_params.h" | 156 // this struct and the #include "chrome/common/render_messages_params.h" |
156 // above. | 157 // above. |
157 ViewHostMsg_Resource_Request request; | 158 ResourceHostMsg_Request request; |
158 rv = url_request_context_override_->GetRequestContext(request); | 159 rv = url_request_context_override_->GetRequestContext(request); |
159 } | 160 } |
160 if (!rv) { | 161 if (!rv) { |
161 URLRequestContextGetter* context_getter = | 162 URLRequestContextGetter* context_getter = |
162 Profile::GetDefaultRequestContext(); | 163 Profile::GetDefaultRequestContext(); |
163 if (context_getter) | 164 if (context_getter) |
164 rv = context_getter->GetURLRequestContext(); | 165 rv = context_getter->GetURLRequestContext(); |
165 } | 166 } |
166 | 167 |
167 return rv; | 168 return rv; |
168 } | 169 } |
OLD | NEW |