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

Side by Side Diff: content/renderer/p2p/port_allocator.cc

Issue 8566012: Allow cross-origin requests for relay http requests made in Transport API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
Wez 2011/11/14 21:00:47 Best to create a bug for this and refer to it here
180 options.crossOriginRequestPolicy = 183 options.crossOriginRequestPolicy =
181 WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl; 184 WebURLLoaderOptions::CrossOriginRequestPolicyAllow;
185
182 relay_session_request_.reset( 186 relay_session_request_.reset(
183 allocator_->web_frame_->createAssociatedURLLoader(options)); 187 allocator_->web_frame_->createAssociatedURLLoader(options));
184 if (!relay_session_request_.get()) { 188 if (!relay_session_request_.get()) {
185 LOG(ERROR) << "Failed to create URL loader."; 189 LOG(ERROR) << "Failed to create URL loader.";
186 return; 190 return;
187 } 191 }
188 192
189 WebURLRequest request; 193 WebURLRequest request;
190 request.initialize(); 194 request.initialize();
191 request.setURL(WebURL(GURL( 195 request.setURL(WebURL(GURL(
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 if (relay_ssltcp_port_ > 0 && !allocator_->config_.disable_tcp_transport) { 277 if (relay_ssltcp_port_ > 0 && !allocator_->config_.disable_tcp_transport) {
274 talk_base::SocketAddress address(relay_ip_.ip(), relay_ssltcp_port_); 278 talk_base::SocketAddress address(relay_ip_.ip(), relay_ssltcp_port_);
275 ports.push_back(cricket::ProtocolAddress(address, cricket::PROTO_SSLTCP)); 279 ports.push_back(cricket::ProtocolAddress(address, cricket::PROTO_SSLTCP));
276 } 280 }
277 } 281 }
278 config->AddRelay(ports, 0.0f); 282 config->AddRelay(ports, 0.0f);
279 ConfigReady(config); 283 ConfigReady(config);
280 } 284 }
281 285
282 } // namespace content 286 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698