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 <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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 #endif | 150 #endif |
151 base::AtExitManager exit_manager; | 151 base::AtExitManager exit_manager; |
152 CommandLine::Init(argc, argv); | 152 CommandLine::Init(argc, argv); |
153 logging::InitLogging( | 153 logging::InitLogging( |
154 NULL, | 154 NULL, |
155 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, | 155 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, |
156 logging::LOCK_LOG_FILE, | 156 logging::LOCK_LOG_FILE, |
157 logging::DELETE_OLD_LOG_FILE, | 157 logging::DELETE_OLD_LOG_FILE, |
158 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 158 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
159 | 159 |
160 MessageLoop ui_loop; | 160 base::MessageLoop ui_loop; |
161 base::Thread io_thread("IO thread"); | 161 base::Thread io_thread("IO thread"); |
162 base::Thread::Options options; | 162 base::Thread::Options options; |
163 options.message_loop_type = MessageLoop::TYPE_IO; | 163 options.message_loop_type = base::MessageLoop::TYPE_IO; |
164 io_thread.StartWithOptions(options); | 164 io_thread.StartWithOptions(options); |
165 | 165 |
166 // Parse command line. | 166 // Parse command line. |
167 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 167 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
168 std::string email = command_line.GetSwitchValueASCII(kEmailSwitch); | 168 std::string email = command_line.GetSwitchValueASCII(kEmailSwitch); |
169 std::string token = command_line.GetSwitchValueASCII(kTokenSwitch); | 169 std::string token = command_line.GetSwitchValueASCII(kTokenSwitch); |
170 // TODO(akalin): Write a wrapper script that gets a token for an | 170 // TODO(akalin): Write a wrapper script that gets a token for an |
171 // email and password and passes that in to this utility. | 171 // email and password and passes that in to this utility. |
172 if (email.empty() || token.empty()) { | 172 if (email.empty() || token.empty()) { |
173 std::printf("Usage: %s --%s=foo@bar.com --%s=token\n" | 173 std::printf("Usage: %s --%s=foo@bar.com --%s=token\n" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 io_thread.Stop(); | 214 io_thread.Stop(); |
215 return 0; | 215 return 0; |
216 } | 216 } |
217 | 217 |
218 } // namespace | 218 } // namespace |
219 } // namespace syncer | 219 } // namespace syncer |
220 | 220 |
221 int main(int argc, char* argv[]) { | 221 int main(int argc, char* argv[]) { |
222 return syncer::SyncListenNotificationsMain(argc, argv); | 222 return syncer::SyncListenNotificationsMain(argc, argv); |
223 } | 223 } |
OLD | NEW |