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 "remoting/host/host_port_allocator.h" | 5 #include "remoting/host/host_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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 cricket::BasicPortAllocatorSession::ConfigReady(config); | 85 cricket::BasicPortAllocatorSession::ConfigReady(config); |
86 } | 86 } |
87 | 87 |
88 void HostPortAllocatorSession::SendSessionRequest(const std::string& host, | 88 void HostPortAllocatorSession::SendSessionRequest(const std::string& host, |
89 int port) { | 89 int port) { |
90 GURL url("https://" + host + ":" + base::IntToString(port) + | 90 GURL url("https://" + host + ":" + base::IntToString(port) + |
91 GetSessionRequestUrl() + "&sn=1"); | 91 GetSessionRequestUrl() + "&sn=1"); |
92 scoped_ptr<net::URLFetcher> url_fetcher( | 92 scoped_ptr<net::URLFetcher> url_fetcher( |
93 net::URLFetcher::Create(url, net::URLFetcher::GET, this)); | 93 net::URLFetcher::Create(url, net::URLFetcher::GET, this)); |
94 url_fetcher->SetRequestContext(url_context_); | 94 url_fetcher->SetRequestContext(url_context_.get()); |
95 url_fetcher->AddExtraRequestHeader( | 95 url_fetcher->AddExtraRequestHeader( |
96 "X-Talk-Google-Relay-Auth: " + relay_token()); | 96 "X-Talk-Google-Relay-Auth: " + relay_token()); |
97 url_fetcher->AddExtraRequestHeader("X-Google-Relay-Auth: " + relay_token()); | 97 url_fetcher->AddExtraRequestHeader("X-Google-Relay-Auth: " + relay_token()); |
98 url_fetcher->AddExtraRequestHeader("X-Stream-Type: chromoting"); | 98 url_fetcher->AddExtraRequestHeader("X-Stream-Type: chromoting"); |
99 url_fetcher->Start(); | 99 url_fetcher->Start(); |
100 url_fetchers_.insert(url_fetcher.release()); | 100 url_fetchers_.insert(url_fetcher.release()); |
101 } | 101 } |
102 | 102 |
103 void HostPortAllocatorSession::OnURLFetchComplete( | 103 void HostPortAllocatorSession::OnURLFetchComplete( |
104 const net::URLFetcher* source) { | 104 const net::URLFetcher* source) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 const std::string& content_name, | 170 const std::string& content_name, |
171 int component, | 171 int component, |
172 const std::string& ice_username_fragment, | 172 const std::string& ice_username_fragment, |
173 const std::string& ice_password) { | 173 const std::string& ice_password) { |
174 return new HostPortAllocatorSession( | 174 return new HostPortAllocatorSession( |
175 this, content_name, component, ice_username_fragment, ice_password, | 175 this, content_name, component, ice_username_fragment, ice_password, |
176 stun_hosts(), relay_hosts(), relay_token(), url_context_); | 176 stun_hosts(), relay_hosts(), relay_token(), url_context_); |
177 } | 177 } |
178 | 178 |
179 } // namespace remoting | 179 } // namespace remoting |
OLD | NEW |