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

Side by Side Diff: remoting/protocol/chromium_port_allocator.cc

Issue 966433002: Malformed PortRange or ThirdPartyAuthConfig trigger OnPolicyError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing a Windows-specific, pre-processor-related build break. Created 5 years, 9 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "remoting/protocol/chromium_port_allocator.h" 5 #include "remoting/protocol/chromium_port_allocator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/http/http_status_code.h" 10 #include "net/http/http_status_code.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | 149 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG |
150 cricket::PORTALLOCATOR_ENABLE_IPV6; 150 cricket::PORTALLOCATOR_ENABLE_IPV6;
151 151
152 if (!(network_settings.flags & NetworkSettings::NAT_TRAVERSAL_STUN)) 152 if (!(network_settings.flags & NetworkSettings::NAT_TRAVERSAL_STUN))
153 flags |= cricket::PORTALLOCATOR_DISABLE_STUN; 153 flags |= cricket::PORTALLOCATOR_DISABLE_STUN;
154 154
155 if (!(network_settings.flags & NetworkSettings::NAT_TRAVERSAL_RELAY)) 155 if (!(network_settings.flags & NetworkSettings::NAT_TRAVERSAL_RELAY))
156 flags |= cricket::PORTALLOCATOR_DISABLE_RELAY; 156 flags |= cricket::PORTALLOCATOR_DISABLE_RELAY;
157 157
158 result->set_flags(flags); 158 result->set_flags(flags);
159 result->SetPortRange(network_settings.min_port, 159 result->SetPortRange(network_settings.port_range.min_port,
160 network_settings.max_port); 160 network_settings.port_range.max_port);
161 161
162 return result.Pass(); 162 return result.Pass();
163 } 163 }
164 164
165 ChromiumPortAllocator::ChromiumPortAllocator( 165 ChromiumPortAllocator::ChromiumPortAllocator(
166 const scoped_refptr<net::URLRequestContextGetter>& url_context, 166 const scoped_refptr<net::URLRequestContextGetter>& url_context,
167 scoped_ptr<rtc::NetworkManager> network_manager, 167 scoped_ptr<rtc::NetworkManager> network_manager,
168 scoped_ptr<rtc::PacketSocketFactory> socket_factory) 168 scoped_ptr<rtc::PacketSocketFactory> socket_factory)
169 : HttpPortAllocatorBase(network_manager.get(), 169 : HttpPortAllocatorBase(network_manager.get(),
170 socket_factory.get(), 170 socket_factory.get(),
(...skipping 10 matching lines...) Expand all
181 int component, 181 int component,
182 const std::string& ice_username_fragment, 182 const std::string& ice_username_fragment,
183 const std::string& ice_password) { 183 const std::string& ice_password) {
184 return new ChromiumPortAllocatorSession( 184 return new ChromiumPortAllocatorSession(
185 this, content_name, component, ice_username_fragment, ice_password, 185 this, content_name, component, ice_username_fragment, ice_password,
186 stun_hosts(), relay_hosts(), relay_token(), url_context_); 186 stun_hosts(), relay_hosts(), relay_token(), url_context_);
187 } 187 }
188 188
189 } // namespace protocol 189 } // namespace protocol
190 } // namespace remoting 190 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/token_validator_base.h ('k') | remoting/protocol/me2me_host_authenticator_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698