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

Side by Side Diff: remoting/host/setup/start_host.cc

Issue 17109006: Device robot refresh token integrity validation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix remoting compile error on windows Created 7 years, 6 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
« no previous file with comments | « remoting/host/setup/host_starter.cc ('k') | remoting/host/setup/win/start_host_window.cc » ('j') | 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) 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 <stdio.h> 5 #include <stdio.h>
6 #include <termios.h> 6 #include <termios.h>
7 7
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "base/threading/thread.h" 12 #include "base/threading/thread.h"
13 #include "google_apis/gaia/gaia_urls.h"
14 #include "net/url_request/url_fetcher.h" 13 #include "net/url_request/url_fetcher.h"
15 #include "net/url_request/url_request_context_getter.h" 14 #include "net/url_request/url_request_context_getter.h"
16 #include "remoting/host/service_urls.h" 15 #include "remoting/host/service_urls.h"
17 #include "remoting/host/setup/host_starter.h" 16 #include "remoting/host/setup/host_starter.h"
18 #include "remoting/host/setup/oauth_helper.h" 17 #include "remoting/host/setup/oauth_helper.h"
19 #include "remoting/host/setup/pin_validator.h" 18 #include "remoting/host/setup/pin_validator.h"
20 #include "remoting/host/url_request_context.h" 19 #include "remoting/host/url_request_context.h"
21 20
22 // A simple command-line app that registers and starts a host. 21 // A simple command-line app that registers and starts a host.
23 22
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 new remoting::URLRequestContextGetter( 152 new remoting::URLRequestContextGetter(
154 g_message_loop->message_loop_proxy(), 153 g_message_loop->message_loop_proxy(),
155 io_thread.message_loop_proxy())); 154 io_thread.message_loop_proxy()));
156 155
157 if (remoting::ServiceUrls::GetInstance()->ignore_urlfetcher_cert_requests()) { 156 if (remoting::ServiceUrls::GetInstance()->ignore_urlfetcher_cert_requests()) {
158 net::URLFetcher::SetIgnoreCertificateRequests(true); 157 net::URLFetcher::SetIgnoreCertificateRequests(true);
159 } 158 }
160 159
161 // Start the host. 160 // Start the host.
162 scoped_ptr<HostStarter> host_starter(HostStarter::Create( 161 scoped_ptr<HostStarter> host_starter(HostStarter::Create(
163 GaiaUrls::GetInstance()->oauth2_token_url(),
164 remoting::ServiceUrls::GetInstance()->directory_hosts_url(), 162 remoting::ServiceUrls::GetInstance()->directory_hosts_url(),
165 url_request_context_getter.get())); 163 url_request_context_getter.get()));
166 if (redirect_url.empty()) { 164 if (redirect_url.empty()) {
167 redirect_url = remoting::GetDefaultOauthRedirectUrl(); 165 redirect_url = remoting::GetDefaultOauthRedirectUrl();
168 } 166 }
169 host_starter->StartHost(host_name, host_pin, true, auth_code, redirect_url, 167 host_starter->StartHost(host_name, host_pin, true, auth_code, redirect_url,
170 base::Bind(&OnDone)); 168 base::Bind(&OnDone));
171 169
172 // Run the message loop until the StartHost completion callback. 170 // Run the message loop until the StartHost completion callback.
173 base::RunLoop run_loop; 171 base::RunLoop run_loop;
174 run_loop.Run(); 172 run_loop.Run();
175 173
176 g_message_loop = NULL; 174 g_message_loop = NULL;
177 175
178 // Destroy the HostStarter and URLRequestContextGetter before stopping the 176 // Destroy the HostStarter and URLRequestContextGetter before stopping the
179 // IO thread. 177 // IO thread.
180 host_starter.reset(); 178 host_starter.reset();
181 url_request_context_getter = NULL; 179 url_request_context_getter = NULL;
182 180
183 io_thread.Stop(); 181 io_thread.Stop();
184 182
185 return g_started ? 0 : 1; 183 return g_started ? 0 : 1;
186 } 184 }
OLDNEW
« no previous file with comments | « remoting/host/setup/host_starter.cc ('k') | remoting/host/setup/win/start_host_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698