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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 | 171 |
172 if (relay_session_attempts_ > kRelaySessionRetries) | 172 if (relay_session_attempts_ > kRelaySessionRetries) |
173 return; | 173 return; |
174 relay_session_attempts_++; | 174 relay_session_attempts_++; |
175 | 175 |
176 relay_session_response_.clear(); | 176 relay_session_response_.clear(); |
177 | 177 |
178 WebURLLoaderOptions options; | 178 WebURLLoaderOptions options; |
179 options.allowCredentials = false; | 179 options.allowCredentials = false; |
| 180 |
| 181 // TODO(sergeyu): Set to CrossOriginRequestPolicyUseAccessControl |
| 182 // when this code can be used by untrusted plugins. |
| 183 // See http://crbug.com/104195 . |
180 options.crossOriginRequestPolicy = | 184 options.crossOriginRequestPolicy = |
181 WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl; | 185 WebURLLoaderOptions::CrossOriginRequestPolicyAllow; |
| 186 |
182 relay_session_request_.reset( | 187 relay_session_request_.reset( |
183 allocator_->web_frame_->createAssociatedURLLoader(options)); | 188 allocator_->web_frame_->createAssociatedURLLoader(options)); |
184 if (!relay_session_request_.get()) { | 189 if (!relay_session_request_.get()) { |
185 LOG(ERROR) << "Failed to create URL loader."; | 190 LOG(ERROR) << "Failed to create URL loader."; |
186 return; | 191 return; |
187 } | 192 } |
188 | 193 |
189 WebURLRequest request; | 194 WebURLRequest request; |
190 request.initialize(); | 195 request.initialize(); |
191 request.setURL(WebURL(GURL( | 196 request.setURL(WebURL(GURL( |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 if (relay_ssltcp_port_ > 0 && !allocator_->config_.disable_tcp_transport) { | 278 if (relay_ssltcp_port_ > 0 && !allocator_->config_.disable_tcp_transport) { |
274 talk_base::SocketAddress address(relay_ip_.ip(), relay_ssltcp_port_); | 279 talk_base::SocketAddress address(relay_ip_.ip(), relay_ssltcp_port_); |
275 ports.push_back(cricket::ProtocolAddress(address, cricket::PROTO_SSLTCP)); | 280 ports.push_back(cricket::ProtocolAddress(address, cricket::PROTO_SSLTCP)); |
276 } | 281 } |
277 } | 282 } |
278 config->AddRelay(ports, 0.0f); | 283 config->AddRelay(ports, 0.0f); |
279 ConfigReady(config); | 284 ConfigReady(config); |
280 } | 285 } |
281 | 286 |
282 } // namespace content | 287 } // namespace content |
OLD | NEW |