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

Issue 6713032: Provide lazy CommitPendingWrites in addition to eager SavePersistentPrefs. (Closed)

Created:
9 years, 9 months ago by Denis Lagno
Modified:
9 years, 6 months ago
CC:
chromium-reviews, davemoore+watch_chromium.org, battre
Visibility:
Public.

Description

Provide lazy CommitPendingWrites in addition to eager SavePersistentPrefs. We need to land pending writes to disk before doing chromeos::RestartJob. However SavePersistentPrefs is not lazy and takes time even if there is nothing to write. Fix it. BUG=chromium-os:13102, chromium-os:6924 TEST=Manual Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=79387

Patch Set 1 #

Patch Set 2 : rename less confusing #

Total comments: 5

Patch Set 3 : added notification #

Patch Set 4 : rebase #

Patch Set 5 : c #

Patch Set 6 : conditionalize on OS_CHROMEOS #

Patch Set 7 : for test #

Total comments: 1

Patch Set 8 : added ifdef #

Patch Set 9 : removed notification + rebase #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -20 lines) Patch
M chrome/browser/chromeos/cros/login_library.cc View 1 2 3 4 5 6 7 8 4 chunks +55 lines, -7 lines 0 comments Download
M chrome/browser/chromeos/login/owner_manager.cc View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/prefs/overlay_persistent_pref_store.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/prefs/overlay_persistent_pref_store.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/prefs/pref_service.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/prefs/pref_service.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/prefs/testing_pref_store.h View 1 2 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/important_file_writer.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -3 lines 2 comments Download
M chrome/common/json_pref_store.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
M chrome/common/json_pref_store.cc View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -3 lines 0 comments Download
M chrome/common/persistent_pref_store.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
Denis Lagno
9 years, 9 months ago (2011-03-18 15:17:38 UTC) #1
Denis Lagno
ping
9 years, 9 months ago (2011-03-22 14:00:52 UTC) #2
Mattias Nissler (ping if slow)
What does that RestartJob do? Restart the chrome process? In this case, the pref file ...
9 years, 9 months ago (2011-03-22 14:36:57 UTC) #3
Denis Lagno
On 2011/03/22 14:36:57, Mattias Nissler wrote: > What does that RestartJob do? Restart the chrome ...
9 years, 9 months ago (2011-03-22 14:50:13 UTC) #4
Mattias Nissler (ping if slow)
On 2011/03/22 14:50:13, Denis Lagno wrote: > On 2011/03/22 14:36:57, Mattias Nissler wrote: > > ...
9 years, 9 months ago (2011-03-22 14:56:00 UTC) #5
Denis Lagno
it sends SIGKILL. src/platform/login_manager/session_manager_service.cc in chromeos code
9 years, 9 months ago (2011-03-22 14:57:10 UTC) #6
Nikita (slow)
cc:cmasone for session_manager. What we do for Guest mode is send SIGKILL immediately which is ...
9 years, 9 months ago (2011-03-22 15:05:49 UTC) #7
Mattias Nissler (ping if slow)
On 2011/03/22 15:05:49, Nikita Kostylev wrote: > cc:cmasone for session_manager. > > What we do ...
9 years, 9 months ago (2011-03-22 15:35:00 UTC) #8
Denis Lagno
On 2011/03/22 15:35:00, Mattias Nissler wrote: > But for guest mode, we shouldn't require writing ...
9 years, 9 months ago (2011-03-22 15:54:42 UTC) #9
Mattias Nissler (ping if slow)
On 2011/03/22 15:54:42, Denis Lagno wrote: > On 2011/03/22 15:35:00, Mattias Nissler wrote: > > ...
9 years, 9 months ago (2011-03-22 16:52:47 UTC) #10
Mattias Nissler (ping if slow)
http://codereview.chromium.org/6713032/diff/11/chrome/browser/chromeos/cros/login_library.cc File chrome/browser/chromeos/cros/login_library.cc (right): http://codereview.chromium.org/6713032/diff/11/chrome/browser/chromeos/cros/login_library.cc#newcode140 chrome/browser/chromeos/cros/login_library.cc:140: return chromeos::RestartJob(pid, command_line.c_str()); On which thread does this run? ...
9 years, 9 months ago (2011-03-22 16:56:20 UTC) #11
Denis Lagno
http://codereview.chromium.org/6713032/diff/11/chrome/browser/chromeos/cros/login_library.cc File chrome/browser/chromeos/cros/login_library.cc (right): http://codereview.chromium.org/6713032/diff/11/chrome/browser/chromeos/cros/login_library.cc#newcode140 chrome/browser/chromeos/cros/login_library.cc:140: return chromeos::RestartJob(pid, command_line.c_str()); On 2011/03/22 16:56:20, Mattias Nissler wrote: ...
9 years, 9 months ago (2011-03-22 16:58:12 UTC) #12
Denis Lagno
http://codereview.chromium.org/6713032/diff/11/chrome/browser/chromeos/cros/login_library.cc File chrome/browser/chromeos/cros/login_library.cc (right): http://codereview.chromium.org/6713032/diff/11/chrome/browser/chromeos/cros/login_library.cc#newcode140 chrome/browser/chromeos/cros/login_library.cc:140: return chromeos::RestartJob(pid, command_line.c_str()); OTOH it looks like RestartJob is ...
9 years, 9 months ago (2011-03-22 17:08:40 UTC) #13
Mattias Nissler (ping if slow)
http://codereview.chromium.org/6713032/diff/11/chrome/browser/chromeos/cros/login_library.cc File chrome/browser/chromeos/cros/login_library.cc (right): http://codereview.chromium.org/6713032/diff/11/chrome/browser/chromeos/cros/login_library.cc#newcode140 chrome/browser/chromeos/cros/login_library.cc:140: return chromeos::RestartJob(pid, command_line.c_str()); On 2011/03/22 17:08:40, Denis Lagno wrote: ...
9 years, 9 months ago (2011-03-22 17:27:02 UTC) #14
Denis Lagno
adding reviewer from content/OWNERS http://codereview.chromium.org/6713032/diff/11/chrome/browser/chromeos/cros/login_library.cc File chrome/browser/chromeos/cros/login_library.cc (right): http://codereview.chromium.org/6713032/diff/11/chrome/browser/chromeos/cros/login_library.cc#newcode140 chrome/browser/chromeos/cros/login_library.cc:140: return chromeos::RestartJob(pid, command_line.c_str()); On 2011/03/22 ...
9 years, 9 months ago (2011-03-23 14:37:43 UTC) #15
Chris Masone
login_library.cc changes LGTM Am I not an OWNER of that? I should be...
9 years, 9 months ago (2011-03-23 14:49:07 UTC) #16
Denis Lagno
On 2011/03/23 14:49:07, Chris Masone wrote: > Am I not an OWNER of that? I ...
9 years, 9 months ago (2011-03-23 14:55:49 UTC) #17
Mattias Nissler (ping if slow)
I think the approach for generating the notification is not the correct one (see comment ...
9 years, 9 months ago (2011-03-23 15:12:37 UTC) #18
brettw
I agree with Mattias. I don't see why the important file write is sending pref ...
9 years, 9 months ago (2011-03-23 15:49:02 UTC) #19
Mattias Nissler (ping if slow)
On 2011/03/23 15:49:02, brettw wrote: > I agree with Mattias. I don't see why the ...
9 years, 9 months ago (2011-03-23 15:56:53 UTC) #20
Denis Lagno
I do not agree that it is not well-defined or flawed. Just need to rename ...
9 years, 9 months ago (2011-03-23 20:46:42 UTC) #21
Mattias Nissler (ping if slow)
On 2011/03/23 20:46:42, Denis Lagno wrote: > I do not agree that it is not ...
9 years, 9 months ago (2011-03-23 21:25:25 UTC) #22
Denis Lagno
On 2011/03/23 21:25:25, Mattias Nissler wrote: > On 2011/03/23 20:46:42, Denis Lagno wrote: > > ...
9 years, 9 months ago (2011-03-23 22:09:59 UTC) #23
Mattias Nissler (ping if slow)
On 2011/03/23 22:09:59, Denis Lagno wrote: > On 2011/03/23 21:25:25, Mattias Nissler wrote: > > ...
9 years, 9 months ago (2011-03-25 14:59:18 UTC) #24
Denis Lagno
On 2011/03/25 14:59:18, Mattias Nissler wrote: > Why has this been committed without LGTM? Ehhr, ...
9 years, 9 months ago (2011-03-25 15:13:50 UTC) #25
Mattias Nissler (ping if slow)
On 2011/03/25 15:13:50, Denis Lagno wrote: > On 2011/03/25 14:59:18, Mattias Nissler wrote: > > ...
9 years, 9 months ago (2011-03-25 15:25:51 UTC) #26
Mattias Nissler (ping if slow)
LGTM with a nit for everything except login_library.cc. If you haven't already, you should make ...
9 years, 9 months ago (2011-03-25 15:29:57 UTC) #27
Denis Lagno
> I think one of the problems here is that I didn't realize that in ...
9 years, 9 months ago (2011-03-25 15:41:22 UTC) #28
Mattias Nissler (ping if slow)
9 years, 9 months ago (2011-03-25 18:14:58 UTC) #29
On 2011/03/25 15:41:22, Denis Lagno wrote:
> > I think one of the problems here is that I didn't realize that in addition
to
> the conversation we had in comments you also made changes I should have looked
> at. I'm sorry for not noticing. However, people usually indicate in their
> comments that there's an update to the code.
> 
> I've clearly indicated "I switched to simple solution" -- it is past tense.

I agree, and I'm sorry I missed the code update. However, a ping would have
nicely resolved the uncertainty.

> 
>
http://codereview.chromium.org/6713032/diff/18001/chrome/common/important_fil...
> File chrome/common/important_file_writer.cc (right):
> 
>
http://codereview.chromium.org/6713032/diff/18001/chrome/common/important_fil...
> chrome/common/important_file_writer.cc:110: FROM_HERE, new
> WriteToDiskTask(path_, data))) {
> On 2011/03/25 15:29:57, Mattias Nissler wrote:
> > any reason for the formatting change here? I found the previous version
easier
> > to read.
> 
> In old versions of CL there was argument added, now it is gone so it remained
in
> CL by mistake.
> 
> However at least one reason to prefer indentation on the right is that if you
> ever need to rename some identifiers then indentation on the right will just
> remain correct while indentation on the left needs to be reformatted.

I guess usually we optimize code for readability in the state it is currently
in, and not for possible future modifications. Anyway, it's just a nit and I
think it's not worth the effort of a follow-up CL to change it.

Powered by Google App Engine
This is Rietveld 408576698