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

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

Issue 2082363002: Remove calls to deprecated MessageLoop methods in remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing include Created 4 years, 5 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 (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/setup/start_host_main.h" 5 #include "remoting/host/setup/start_host_main.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 size_t newline_index = str.find('\n'); 81 size_t newline_index = str.find('\n');
82 if (newline_index != std::string::npos) 82 if (newline_index != std::string::npos)
83 str[newline_index] = '\0'; 83 str[newline_index] = '\0';
84 str.resize(strlen(&str[0])); 84 str.resize(strlen(&str[0]));
85 return str; 85 return str;
86 } 86 }
87 87
88 // Called when the HostStarter has finished. 88 // Called when the HostStarter has finished.
89 void OnDone(HostStarter::Result result) { 89 void OnDone(HostStarter::Result result) {
90 if (!g_message_loop->task_runner()->BelongsToCurrentThread()) { 90 if (!g_message_loop->task_runner()->BelongsToCurrentThread()) {
91 g_message_loop->PostTask(FROM_HERE, base::Bind(&OnDone, result)); 91 g_message_loop->task_runner()->PostTask(FROM_HERE,
92 base::Bind(&OnDone, result));
92 return; 93 return;
93 } 94 }
94 switch (result) { 95 switch (result) {
95 case HostStarter::START_COMPLETE: 96 case HostStarter::START_COMPLETE:
96 g_started = true; 97 g_started = true;
97 break; 98 break;
98 case HostStarter::NETWORK_ERROR: 99 case HostStarter::NETWORK_ERROR:
99 fprintf(stderr, "Couldn't start host: network error.\n"); 100 fprintf(stderr, "Couldn't start host: network error.\n");
100 break; 101 break;
101 case HostStarter::OAUTH_ERROR: 102 case HostStarter::OAUTH_ERROR:
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // IO thread. 234 // IO thread.
234 host_starter.reset(); 235 host_starter.reset();
235 url_request_context_getter = nullptr; 236 url_request_context_getter = nullptr;
236 237
237 io_thread.Stop(); 238 io_thread.Stop();
238 239
239 return g_started ? 0 : 1; 240 return g_started ? 0 : 1;
240 } 241 }
241 242
242 } // namespace remoting 243 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/resizing_host_observer_unittest.cc ('k') | remoting/host/token_validator_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698