OLD | NEW |
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 79 matching lines...) Loading... |
90 relay->ports = filtered_ports; | 90 relay->ports = filtered_ports; |
91 } | 91 } |
92 cricket::BasicPortAllocatorSession::ConfigReady(config); | 92 cricket::BasicPortAllocatorSession::ConfigReady(config); |
93 } | 93 } |
94 | 94 |
95 void ChromiumPortAllocatorSession::SendSessionRequest( | 95 void ChromiumPortAllocatorSession::SendSessionRequest( |
96 const std::string& host, | 96 const std::string& host, |
97 int port) { | 97 int port) { |
98 GURL url("https://" + host + ":" + base::IntToString(port) + | 98 GURL url("https://" + host + ":" + base::IntToString(port) + |
99 GetSessionRequestUrl() + "&sn=1"); | 99 GetSessionRequestUrl() + "&sn=1"); |
100 scoped_ptr<net::URLFetcher> url_fetcher( | 100 scoped_ptr<net::URLFetcher> url_fetcher = |
101 net::URLFetcher::Create(url, net::URLFetcher::GET, this)); | 101 net::URLFetcher::Create(url, net::URLFetcher::GET, this); |
102 url_fetcher->SetRequestContext(url_context_.get()); | 102 url_fetcher->SetRequestContext(url_context_.get()); |
103 url_fetcher->AddExtraRequestHeader("X-Talk-Google-Relay-Auth: " + | 103 url_fetcher->AddExtraRequestHeader("X-Talk-Google-Relay-Auth: " + |
104 relay_token()); | 104 relay_token()); |
105 url_fetcher->AddExtraRequestHeader("X-Google-Relay-Auth: " + relay_token()); | 105 url_fetcher->AddExtraRequestHeader("X-Google-Relay-Auth: " + relay_token()); |
106 url_fetcher->AddExtraRequestHeader("X-Stream-Type: chromoting"); | 106 url_fetcher->AddExtraRequestHeader("X-Stream-Type: chromoting"); |
107 url_fetcher->Start(); | 107 url_fetcher->Start(); |
108 url_fetchers_.insert(url_fetcher.release()); | 108 url_fetchers_.insert(url_fetcher.release()); |
109 } | 109 } |
110 | 110 |
111 void ChromiumPortAllocatorSession::OnURLFetchComplete( | 111 void ChromiumPortAllocatorSession::OnURLFetchComplete( |
(...skipping 69 matching lines...) Loading... |
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 |
OLD | NEW |