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

Side by Side Diff: sync/tools/sync_client.cc

Issue 14113050: sync: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « sync/test/engine/syncer_command_test.h ('k') | sync/tools/sync_listen_notifications.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 <cstddef> 5 #include <cstddef>
6 #include <cstdio> 6 #include <cstdio>
7 #include <string> 7 #include <string>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 #endif 230 #endif
231 base::AtExitManager exit_manager; 231 base::AtExitManager exit_manager;
232 CommandLine::Init(argc, argv); 232 CommandLine::Init(argc, argv);
233 logging::InitLogging( 233 logging::InitLogging(
234 NULL, 234 NULL,
235 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, 235 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
236 logging::LOCK_LOG_FILE, 236 logging::LOCK_LOG_FILE,
237 logging::DELETE_OLD_LOG_FILE, 237 logging::DELETE_OLD_LOG_FILE,
238 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); 238 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
239 239
240 MessageLoop sync_loop; 240 base::MessageLoop sync_loop;
241 base::Thread io_thread("IO thread"); 241 base::Thread io_thread("IO thread");
242 base::Thread::Options options; 242 base::Thread::Options options;
243 options.message_loop_type = MessageLoop::TYPE_IO; 243 options.message_loop_type = base::MessageLoop::TYPE_IO;
244 io_thread.StartWithOptions(options); 244 io_thread.StartWithOptions(options);
245 245
246 // Parse command line. 246 // Parse command line.
247 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 247 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
248 SyncCredentials credentials; 248 SyncCredentials credentials;
249 credentials.email = command_line.GetSwitchValueASCII(kEmailSwitch); 249 credentials.email = command_line.GetSwitchValueASCII(kEmailSwitch);
250 credentials.sync_token = command_line.GetSwitchValueASCII(kTokenSwitch); 250 credentials.sync_token = command_line.GetSwitchValueASCII(kTokenSwitch);
251 // TODO(akalin): Write a wrapper script that gets a token for an 251 // TODO(akalin): Write a wrapper script that gets a token for an
252 // email and password and passes that in to this utility. 252 // email and password and passes that in to this utility.
253 if (credentials.email.empty() || credentials.sync_token.empty()) { 253 if (credentials.email.empty() || credentials.sync_token.empty()) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 io_thread.Stop(); 358 io_thread.Stop();
359 return 0; 359 return 0;
360 } 360 }
361 361
362 } // namespace 362 } // namespace
363 } // namespace syncer 363 } // namespace syncer
364 364
365 int main(int argc, char* argv[]) { 365 int main(int argc, char* argv[]) {
366 return syncer::SyncClientMain(argc, argv); 366 return syncer::SyncClientMain(argc, argv);
367 } 367 }
OLDNEW
« no previous file with comments | « sync/test/engine/syncer_command_test.h ('k') | sync/tools/sync_listen_notifications.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698