OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/cros/login_library.h" | 5 #include "chrome/browser/chromeos/cros/login_library.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/task.h" | 8 #include "base/task.h" |
9 #include "base/timer.h" | 9 #include "base/timer.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 JobRestartRequest(int pid, const std::string& command_line) | 82 JobRestartRequest(int pid, const std::string& command_line) |
83 : pid_(pid), | 83 : pid_(pid), |
84 command_line_(command_line), | 84 command_line_(command_line), |
85 local_state_(g_browser_process->local_state()) { | 85 local_state_(g_browser_process->local_state()) { |
86 AddRef(); | 86 AddRef(); |
87 if (local_state_) { | 87 if (local_state_) { |
88 // XXX: normally this call must not be needed, however RestartJob | 88 // XXX: normally this call must not be needed, however RestartJob |
89 // just kills us so settings may be lost. See http://crosbug.com/13102 | 89 // just kills us so settings may be lost. See http://crosbug.com/13102 |
90 local_state_->CommitPendingWrite(); | 90 local_state_->CommitPendingWrite(); |
91 timer_.Start( | 91 timer_.Start( |
92 FROM_HERE, base::TimeDelta::FromSeconds(3), this, | 92 base::TimeDelta::FromSeconds(3), this, |
93 &JobRestartRequest::RestartJob); | 93 &JobRestartRequest::RestartJob); |
94 // Post task on file thread thus it occurs last on task queue, so it | 94 // Post task on file thread thus it occurs last on task queue, so it |
95 // would be executed after committing pending write on file thread. | 95 // would be executed after committing pending write on file thread. |
96 BrowserThread::PostTask( | 96 BrowserThread::PostTask( |
97 BrowserThread::FILE, FROM_HERE, | 97 BrowserThread::FILE, FROM_HERE, |
98 NewRunnableMethod(this, &JobRestartRequest::RestartJob)); | 98 NewRunnableMethod(this, &JobRestartRequest::RestartJob)); |
99 } else { | 99 } else { |
100 RestartJob(); | 100 RestartJob(); |
101 } | 101 } |
102 } | 102 } |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 234 |
235 // static | 235 // static |
236 LoginLibrary* LoginLibrary::GetImpl(bool stub) { | 236 LoginLibrary* LoginLibrary::GetImpl(bool stub) { |
237 if (stub) | 237 if (stub) |
238 return new LoginLibraryStubImpl(); | 238 return new LoginLibraryStubImpl(); |
239 else | 239 else |
240 return new LoginLibraryImpl(); | 240 return new LoginLibraryImpl(); |
241 } | 241 } |
242 | 242 |
243 } // namespace chromeos | 243 } // namespace chromeos |
OLD | NEW |