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

Side by Side Diff: chrome/browser/chromeos/cros/login_library.cc

Issue 6713032: Provide lazy CommitPendingWrites in addition to eager SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename less confusing Created 9 years, 9 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 | « no previous file | chrome/browser/prefs/overlay_persistent_pref_store.h » ('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) 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 "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/chromeos/cros/cros_library.h" 9 #include "chrome/browser/chromeos/cros/cros_library.h"
10 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" 10 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return chromeos::StopSession(""); 126 return chromeos::StopSession("");
127 } 127 }
128 128
129 bool RestartEntd() { 129 bool RestartEntd() {
130 return chromeos::RestartEntd(); 130 return chromeos::RestartEntd();
131 } 131 }
132 132
133 bool RestartJob(int pid, const std::string& command_line) { 133 bool RestartJob(int pid, const std::string& command_line) {
134 if (g_browser_process && g_browser_process->local_state()) { 134 if (g_browser_process && g_browser_process->local_state()) {
135 // XXX: normally this call must not be needed, however it turned out that 135 // XXX: normally this call must not be needed, however it turned out that
136 // without this explicit call to SavePersistentPrefs it is possible for 136 // without explicit write it is possible for preferences to be lost.
137 // preferences to be lost. See http://crosbug.com/13102 137 // See http://crosbug.com/13102
138 g_browser_process->local_state()->SavePersistentPrefs(); 138 g_browser_process->local_state()->CommitPendingWrites();
139 } 139 }
140 return chromeos::RestartJob(pid, command_line.c_str()); 140 return chromeos::RestartJob(pid, command_line.c_str());
Mattias Nissler (ping if slow) 2011/03/22 16:56:20 On which thread does this run? The CommitPendingWr
Denis Lagno 2011/03/22 16:58:12 absoulutely. I am adding notification to fix this
Denis Lagno 2011/03/22 17:08:40 OTOH it looks like RestartJob is invoked by sendin
Mattias Nissler (ping if slow) 2011/03/22 17:27:02 Does that mean you're willing to take chances? ;)
Denis Lagno 2011/03/23 14:37:43 Done.
141 } 141 }
142 142
143 private: 143 private:
144 static void Handler(void* object, const OwnershipEvent& event) { 144 static void Handler(void* object, const OwnershipEvent& event) {
145 LoginLibraryImpl* self = static_cast<LoginLibraryImpl*>(object); 145 LoginLibraryImpl* self = static_cast<LoginLibraryImpl*>(object);
146 switch (event) { 146 switch (event) {
147 case SetKeySuccess: 147 case SetKeySuccess:
148 self->CompleteSetOwnerKey(true); 148 self->CompleteSetOwnerKey(true);
149 break; 149 break;
150 case SetKeyFailure: 150 case SetKeyFailure:
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 278
279 // static 279 // static
280 LoginLibrary* LoginLibrary::GetImpl(bool stub) { 280 LoginLibrary* LoginLibrary::GetImpl(bool stub) {
281 if (stub) 281 if (stub)
282 return new LoginLibraryStubImpl(); 282 return new LoginLibraryStubImpl();
283 else 283 else
284 return new LoginLibraryImpl(); 284 return new LoginLibraryImpl();
285 } 285 }
286 286
287 } // namespace chromeos 287 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prefs/overlay_persistent_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698