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

Issue 6260002: Fix chromium-os:10777 and other sync related crashes. (Closed)

Created:
9 years, 11 months ago by stevenjb
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Fix chromium-os:10777 and other sync related crashes. Return NULL when GetProfileSyncService() is called without a cros_user argument (if not already initialized) and protect the settings code when sync service is NULL. A side effect of this is that sync will be disabled if chrome is not started from the login screen in ChromeOS (e.g. when debugging), instead of being initialized without a valid backend, so e.g. settings will not have a sync section, and about:sync will show 'sync disabled'. BUG=chromium-os:10777, chromium-os:10893 TEST=Test proxy settings from login screen, sync settings page, and about:sync. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=71457

Patch Set 1 #

Total comments: 4

Patch Set 2 : Remove unnecessry dom_ui->GetOriginalProfile() #

Total comments: 2

Patch Set 3 : Improve comment. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -10 lines) Patch
M chrome/browser/dom_ui/options/personal_options_handler.cc View 1 2 chunks +2 lines, -0 lines 1 comment Download
M chrome/browser/dom_ui/options/sync_options_handler.cc View 1 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 1 chunk +7 lines, -6 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
stevenjb
After trying a few approaches, I like this best, but am open to alternatives.
9 years, 11 months ago (2011-01-13 00:59:59 UTC) #1
akalin
http://codereview.chromium.org/6260002/diff/1/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (left): http://codereview.chromium.org/6260002/diff/1/chrome/browser/profiles/profile_impl.cc#oldcode1251 chrome/browser/profiles/profile_impl.cc:1251: // If kLoginManager is specified, we shouldn't call this ...
9 years, 11 months ago (2011-01-13 04:14:56 UTC) #2
akalin
http://codereview.chromium.org/6260002/diff/1/chrome/browser/dom_ui/dom_ui.h File chrome/browser/dom_ui/dom_ui.h (right): http://codereview.chromium.org/6260002/diff/1/chrome/browser/dom_ui/dom_ui.h#newcode133 chrome/browser/dom_ui/dom_ui.h:133: // Convenience function for UI that requires access to ...
9 years, 11 months ago (2011-01-13 04:38:42 UTC) #3
stevenjb
http://codereview.chromium.org/6260002/diff/1/chrome/browser/dom_ui/dom_ui.h File chrome/browser/dom_ui/dom_ui.h (right): http://codereview.chromium.org/6260002/diff/1/chrome/browser/dom_ui/dom_ui.h#newcode133 chrome/browser/dom_ui/dom_ui.h:133: // Convenience function for UI that requires access to ...
9 years, 11 months ago (2011-01-13 18:00:48 UTC) #4
akalin
On 2011/01/13 18:00:48, Steven Bennetts wrote: > Originally I added checks in the settings code, ...
9 years, 11 months ago (2011-01-13 19:35:08 UTC) #5
stevenjb (google-dont-use)
I can leave in the FATAL check for kLoginManager and add HasProfileSyncService() to the settings ...
9 years, 11 months ago (2011-01-13 20:01:31 UTC) #6
akalin
Sure, I think there's no need for HasPSS() if the calling code handles NULL correctly. ...
9 years, 11 months ago (2011-01-13 20:01:42 UTC) #7
stevenjb (google-dont-use)
But if I leave the FATAL check there, I will have to add the HasProfileSyncService() ...
9 years, 11 months ago (2011-01-13 21:56:12 UTC) #8
akalin
Okay, I think I managed to retrace your reasoning. :) I'm now convinced that returning ...
9 years, 11 months ago (2011-01-13 22:02:42 UTC) #9
akalin
http://codereview.chromium.org/6260002/diff/6001/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): http://codereview.chromium.org/6260002/diff/6001/chrome/browser/profiles/profile_impl.cc#newcode1253 chrome/browser/profiles/profile_impl.cc:1253: // the login code. Use HasProfileSyncService() to guard against ...
9 years, 11 months ago (2011-01-13 22:03:49 UTC) #10
stevenjb
http://codereview.chromium.org/6260002/diff/6001/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): http://codereview.chromium.org/6260002/diff/6001/chrome/browser/profiles/profile_impl.cc#newcode1253 chrome/browser/profiles/profile_impl.cc:1253: // the login code. Use HasProfileSyncService() to guard against ...
9 years, 11 months ago (2011-01-13 22:46:58 UTC) #11
akalin
9 years, 11 months ago (2011-01-14 00:26:37 UTC) #12
LGTM

http://codereview.chromium.org/6260002/diff/20001/chrome/browser/dom_ui/optio...
File chrome/browser/dom_ui/options/personal_options_handler.cc (right):

http://codereview.chromium.org/6260002/diff/20001/chrome/browser/dom_ui/optio...
chrome/browser/dom_ui/options/personal_options_handler.cc:157: DCHECK(service);
I prefer these to be CHECK()s since you're dereferencing them immediately after,
but I leave it to you

Powered by Google App Engine
This is Rietveld 408576698