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

Issue 123693003: Revise user-data-dir switch handling; avoid crashes. (Closed)

Created:
6 years, 11 months ago by msw
Modified:
6 years, 10 months ago
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

Revise user-data-dir switch handling; avoid crashes. Chrome needs a pre-existing or creatable user-data-dir to run. ChromeMainDelegate::PreSandboxStartup was CHECK'ing for this. (crashing on startup with --user-data-dir="M:\invalid") (crashing on startup with --user-data-dir="C:\windows") Supposedly, we had a dialog to let users choose another dir. (I've never gotten this to work on M28-M32 stable versions) Revise the user-data-dir code to warn on invalid paths. (see crbug.com/318999#c18 for the warning screenshot) Then attempt to use the default directory as a backup. (no alternate dir selection UI, users can try again) This should avoid many of the numerous related crashes. BUG=318999 TEST=Supplying an invalid --user-data-dir=<path> will warn users and attempt to use the default directory instead of silently crashing. R=sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251126

Patch Set 1 : Build user_data_dir_dialog on Win Aura. #

Patch Set 2 : Experimenting. #

Patch Set 3 : Work in progress. #

Patch Set 4 : Cleanup. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -254 lines) Patch
M chrome/app/chrome_main_delegate.cc View 1 2 3 3 chunks +0 lines, -31 lines 2 comments Download
M chrome/app/chromium_strings.grd View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/app/generated_resources.grd View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/app/google_chrome_strings.grd View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
D chrome/browser/ui/user_data_dir_dialog.h View 1 2 3 1 chunk +0 lines, -22 lines 0 comments Download
M chrome/browser/user_data_dir_extractor.h View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/user_data_dir_extractor.cc View 1 2 3 1 chunk +90 lines, -5 lines 4 comments Download
A + chrome/browser/user_data_dir_extractor_browsertest.cc View 1 2 3 1 chunk +2 lines, -5 lines 0 comments Download
D chrome/browser/user_data_dir_extractor_win.h View 1 2 3 1 chunk +0 lines, -22 lines 0 comments Download
M chrome/browser/user_data_dir_extractor_win.cc View 1 2 3 1 chunk +0 lines, -82 lines 0 comments Download
D chrome/browser/user_data_dir_extractor_win_browsertest.cc View 1 2 3 1 chunk +0 lines, -72 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 2 chunks +0 lines, -3 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 17 (0 generated)
msw
Hey Scott, please take a look; thanks!
6 years, 10 months ago (2014-02-13 00:50:46 UTC) #1
sky
LGTM https://codereview.chromium.org/123693003/diff/270001/chrome/browser/user_data_dir_extractor.cc File chrome/browser/user_data_dir_extractor.cc (right): https://codereview.chromium.org/123693003/diff/270001/chrome/browser/user_data_dir_extractor.cc#newcode57 chrome/browser/user_data_dir_extractor.cc:57: ResourceBundle::CleanupSharedInstance(); I'm not sure we've ever done this ...
6 years, 10 months ago (2014-02-13 01:35:06 UTC) #2
msw
https://codereview.chromium.org/123693003/diff/270001/chrome/browser/user_data_dir_extractor.cc File chrome/browser/user_data_dir_extractor.cc (right): https://codereview.chromium.org/123693003/diff/270001/chrome/browser/user_data_dir_extractor.cc#newcode57 chrome/browser/user_data_dir_extractor.cc:57: ResourceBundle::CleanupSharedInstance(); On 2014/02/13 01:35:07, sky wrote: > I'm not ...
6 years, 10 months ago (2014-02-13 01:49:33 UTC) #3
msw
The CQ bit was checked by msw@chromium.org
6 years, 10 months ago (2014-02-13 02:20:39 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/123693003/270001
6 years, 10 months ago (2014-02-13 02:22:15 UTC) #5
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-13 04:19:43 UTC) #6
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) app_list_unittests, ash_unittests, aura_unittests, cacheinvalidation_unittests, cc_unittests, check_deps, ...
6 years, 10 months ago (2014-02-13 04:19:44 UTC) #7
msw
The CQ bit was checked by msw@chromium.org
6 years, 10 months ago (2014-02-13 15:54:42 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/123693003/270001
6 years, 10 months ago (2014-02-13 15:55:01 UTC) #9
sky
https://codereview.chromium.org/123693003/diff/270001/chrome/browser/user_data_dir_extractor.cc File chrome/browser/user_data_dir_extractor.cc (right): https://codereview.chromium.org/123693003/diff/270001/chrome/browser/user_data_dir_extractor.cc#newcode57 chrome/browser/user_data_dir_extractor.cc:57: ResourceBundle::CleanupSharedInstance(); On 2014/02/13 01:49:33, msw wrote: > On 2014/02/13 ...
6 years, 10 months ago (2014-02-13 18:01:42 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/123693003/270001
6 years, 10 months ago (2014-02-13 19:46:27 UTC) #11
commit-bot: I haz the power
Change committed as 251126
6 years, 10 months ago (2014-02-13 21:28:00 UTC) #12
Vitaly Buka (NO REVIEWS)
https://codereview.chromium.org/123693003/diff/270001/chrome/app/chrome_main_delegate.cc File chrome/app/chrome_main_delegate.cc (left): https://codereview.chromium.org/123693003/diff/270001/chrome/app/chrome_main_delegate.cc#oldcode608 chrome/app/chrome_main_delegate.cc:608: user_data_dir, We need to revert this part of change ...
6 years, 10 months ago (2014-02-20 11:24:07 UTC) #13
Vitaly Buka (NO REVIEWS)
https://codereview.chromium.org/123693003/diff/270001/chrome/app/chrome_main_delegate.cc File chrome/app/chrome_main_delegate.cc (left): https://codereview.chromium.org/123693003/diff/270001/chrome/app/chrome_main_delegate.cc#oldcode630 chrome/app/chrome_main_delegate.cc:630: logging::InitChromeLogging(command_line, file_state); Actually logging is brocken for all processes ...
6 years, 10 months ago (2014-02-20 11:40:33 UTC) #14
Vitaly Buka (NO REVIEWS)
On 2014/02/20 11:40:33, Vitaly Buka wrote: > https://codereview.chromium.org/123693003/diff/270001/chrome/app/chrome_main_delegate.cc > File chrome/app/chrome_main_delegate.cc (left): > > https://codereview.chromium.org/123693003/diff/270001/chrome/app/chrome_main_delegate.cc#oldcode630 ...
6 years, 10 months ago (2014-02-20 11:52:43 UTC) #15
msw
On 2014/02/20 11:40:33, Vitaly Buka wrote: >Looks we have to either keep initialization in chrome_main_delegate.cc ...
6 years, 10 months ago (2014-02-20 18:13:49 UTC) #16
msw
6 years, 10 months ago (2014-02-20 19:40:00 UTC) #17
Message was sent while issue was closed.
On 2014/02/20 18:13:49, msw wrote:
> On 2014/02/20 11:40:33, Vitaly Buka wrote:
> >Looks we have to either keep initialization in chrome_main_delegate.cc or
> remove all dependent stuff from chrome/common/chrome_paths.h.
> > Now that enum has no use for anything but browser.
> 
> So is the issue that the PathService doesn't initialize the value for
> chrome::DIR_USER_DATA early enough for service processes and logging? If so, I
> think calling chrome::GetUserDataDir from chrome_main_delegate.cc should do
the
> trick. If we do that, we should replace the call in
> ChromeBrowserMainParts::PreCreateThreadsImpl with something that simply
> retrieves the PathService value for chrome::DIR_USER_DATA, rather than
> attempting to parse and override the value from the command-line again. If you
> link me to the bugs with repro steps I can probably make a fix.

Seems so; see a WIP fix at https://codereview.chromium.org/174253002/

Powered by Google App Engine
This is Rietveld 408576698