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/renderer/p2p/port_allocator.h" | 5 #include "content/renderer/p2p/port_allocator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 relay_session_request_.reset( | 182 relay_session_request_.reset( |
183 allocator_->web_frame_->createAssociatedURLLoader(options)); | 183 allocator_->web_frame_->createAssociatedURLLoader(options)); |
184 if (!relay_session_request_.get()) { | 184 if (!relay_session_request_.get()) { |
185 LOG(ERROR) << "Failed to create URL loader."; | 185 LOG(ERROR) << "Failed to create URL loader."; |
186 return; | 186 return; |
187 } | 187 } |
188 | 188 |
189 WebURLRequest request; | 189 WebURLRequest request; |
190 request.initialize(); | 190 request.initialize(); |
191 request.setURL(WebURL(GURL( | 191 request.setURL(WebURL(GURL( |
192 "http://" + allocator_->config_.relay_server + kCreateRelaySessionURL))); | 192 "https://" + allocator_->config_.relay_server + kCreateRelaySessionURL))); |
193 request.setAllowStoredCredentials(false); | 193 request.setAllowStoredCredentials(false); |
194 request.setCachePolicy(WebURLRequest::ReloadIgnoringCacheData); | 194 request.setCachePolicy(WebURLRequest::ReloadIgnoringCacheData); |
195 request.setHTTPMethod("GET"); | 195 request.setHTTPMethod("GET"); |
196 request.addHTTPHeaderField( | 196 request.addHTTPHeaderField( |
197 WebString::fromUTF8("X-Talk-Google-Relay-Auth"), | 197 WebString::fromUTF8("X-Talk-Google-Relay-Auth"), |
198 WebString::fromUTF8(allocator_->config_.relay_password)); | 198 WebString::fromUTF8(allocator_->config_.relay_password)); |
199 request.addHTTPHeaderField( | 199 request.addHTTPHeaderField( |
200 WebString::fromUTF8("X-Google-Relay-Auth"), | 200 WebString::fromUTF8("X-Google-Relay-Auth"), |
201 WebString::fromUTF8(allocator_->config_.relay_password)); | 201 WebString::fromUTF8(allocator_->config_.relay_password)); |
202 request.addHTTPHeaderField(WebString::fromUTF8("X-Session-Type"), | 202 request.addHTTPHeaderField(WebString::fromUTF8("X-Session-Type"), |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 if (relay_ssltcp_port_ > 0 && !allocator_->config_.disable_tcp_transport) { | 273 if (relay_ssltcp_port_ > 0 && !allocator_->config_.disable_tcp_transport) { |
274 talk_base::SocketAddress address(relay_ip_.ip(), relay_ssltcp_port_); | 274 talk_base::SocketAddress address(relay_ip_.ip(), relay_ssltcp_port_); |
275 ports.push_back(cricket::ProtocolAddress(address, cricket::PROTO_SSLTCP)); | 275 ports.push_back(cricket::ProtocolAddress(address, cricket::PROTO_SSLTCP)); |
276 } | 276 } |
277 } | 277 } |
278 config->AddRelay(ports, 0.0f); | 278 config->AddRelay(ports, 0.0f); |
279 ConfigReady(config); | 279 ConfigReady(config); |
280 } | 280 } |
281 | 281 |
282 } // namespace content | 282 } // namespace content |
OLD | NEW |