| OLD | NEW |
| 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 #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_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 relay_session_response_.clear(); | 192 relay_session_response_.clear(); |
| 193 | 193 |
| 194 WebURLLoaderOptions options; | 194 WebURLLoaderOptions options; |
| 195 options.allowCredentials = false; | 195 options.allowCredentials = false; |
| 196 | 196 |
| 197 options.crossOriginRequestPolicy = | 197 options.crossOriginRequestPolicy = |
| 198 WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl; | 198 WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl; |
| 199 | 199 |
| 200 relay_session_request_.reset( | 200 relay_session_request_.reset( |
| 201 allocator_->web_frame_->createAssociatedURLLoader(options)); | 201 allocator_->web_frame_->createAssociatedURLLoader(options)); |
| 202 if (!relay_session_request_.get()) { | 202 if (!relay_session_request_) { |
| 203 LOG(ERROR) << "Failed to create URL loader."; | 203 LOG(ERROR) << "Failed to create URL loader."; |
| 204 return; | 204 return; |
| 205 } | 205 } |
| 206 | 206 |
| 207 std::string url = "https://" + allocator_->config_.relay_server + | 207 std::string url = "https://" + allocator_->config_.relay_server + |
| 208 kCreateRelaySessionURL + | 208 kCreateRelaySessionURL + |
| 209 "?username=" + net::EscapeUrlEncodedData(username(), true) + | 209 "?username=" + net::EscapeUrlEncodedData(username(), true) + |
| 210 "&password=" + net::EscapeUrlEncodedData(password(), true); | 210 "&password=" + net::EscapeUrlEncodedData(password(), true); |
| 211 | 211 |
| 212 WebURLRequest request; | 212 WebURLRequest request; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 // Using the stun resolved address if available for TURN. | 325 // Using the stun resolved address if available for TURN. |
| 326 turn_config.ports.push_back(cricket::ProtocolAddress( | 326 turn_config.ports.push_back(cricket::ProtocolAddress( |
| 327 stun_server_address_, cricket::PROTO_UDP)); | 327 stun_server_address_, cricket::PROTO_UDP)); |
| 328 config->AddRelay(turn_config); | 328 config->AddRelay(turn_config); |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 ConfigReady(config); | 331 ConfigReady(config); |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace content | 334 } // namespace content |
| OLD | NEW |