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

Issue 174253002: Initialize chrome::DIR_USER_DATA early on for service processes, etc. (Closed)

Created:
6 years, 10 months ago by msw
Modified:
6 years, 9 months ago
CC:
chromium-reviews, Andrew Hayden (chromium.org), hshi1, brettw
Visibility:
Public.

Description

Initialize chrome::DIR_USER_DATA early on for service processes, etc. http://crrev.com/251126 broke service/helper processes. (--user-data-dir command-line args weren't respected) Restore the early PathService DIR_USER_DATA init/override. (done as before in ChromeMainDelegate::PreSandboxStartup) Move init code to a file-local InitializeUserDataDir helper. Append the fallback to the commandline for other processes. (otherwise child/service processes re-use the bad dir) Simplify ChromeBrowserMainParts::PreCreateThreadsImpl. (just get DIR_USER_DATA, don't re-attempt init/override) Show a warning messagebox here if user-data-dir was invalid. Move warning UI helper to c/b/ui/startup/bad_flags_prompt.h Add [Get|Set]InvalidSpecifiedUserDataDir for warning UI. (add dynamic_annotations dependency for LazyInstance usage) Remove the ChromeMainUserDataDirTest.GetUserDataDir test. (now ineffective, it can't hook before PreSandboxStartup) BUG=345025, 345582, 318999 TEST=The --user-data-dir command-line argument works as expected for browser, child, and service processes (cloud print connector, chrome logging, etc.). Users are still warned with a dialog when they supply invalid or restricted directory paths for the browser. R=sky@chromium.org,vitalybuka@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=253803

Patch Set 1 #

Total comments: 2

Patch Set 2 : Append the fallback user-data-dir to the commandline. #

Total comments: 1

Patch Set 3 : Remove the now inneffective ChromeMainUserDataDirTest.GetUserDataDir. #

Patch Set 4 : Move utility functions into related files. #

Total comments: 6

Patch Set 5 : Address comments. #

Patch Set 6 : Move helper functions around to avoid dependency issues. #

Total comments: 2

Patch Set 7 : Change CHECK to DCHECK for now. #

Patch Set 8 : Do not run MaybeShowInvalidUserDataDirWarningDialog on Android. #

Patch Set 9 : Remove user data dir init check; tests fail. #

Patch Set 10 : Sync and rebase. #

Total comments: 2

Patch Set 11 : Add dynamic_annotations as a common_constants dependency for LazyInstance. #

Patch Set 12 : Ditto for common_constants_win64; alphabetize. #

Patch Set 13 : Use dynamic_annotations_win64 for common_constants_win64. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -223 lines) Patch
M chrome/app/chrome_main_delegate.cc View 1 2 3 4 5 6 7 8 4 chunks +58 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/ui/startup/bad_flags_prompt.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/startup/bad_flags_prompt.cc View 1 2 3 4 5 2 chunks +38 lines, -0 lines 0 comments Download
M chrome/browser/user_data_dir_extractor.h View 1 2 3 1 chunk +0 lines, -31 lines 0 comments Download
M chrome/browser/user_data_dir_extractor.cc View 1 2 3 1 chunk +0 lines, -111 lines 0 comments Download
D chrome/browser/user_data_dir_extractor_browsertest.cc View 1 2 1 chunk +0 lines, -69 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download
M chrome/common/chrome_paths.h View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/common/chrome_paths.cc View 1 2 3 4 5 6 7 8 4 chunks +15 lines, -3 lines 0 comments Download
M chrome/common_constants.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 74 (0 generated)
msw
Hey Scott and Vitaly, please take a look; thanks! Sorry for the regression, hopefully this ...
6 years, 10 months ago (2014-02-20 19:35:43 UTC) #1
Vitaly Buka (NO REVIEWS)
lgtm https://codereview.chromium.org/174253002/diff/1/chrome/app/chrome_main_delegate.cc File chrome/app/chrome_main_delegate.cc (right): https://codereview.chromium.org/174253002/diff/1/chrome/app/chrome_main_delegate.cc#newcode584 chrome/app/chrome_main_delegate.cc:584: chrome::GetUserDataDir(content::MainFunctionParams(command_line)); Should we fail silently for service or ...
6 years, 10 months ago (2014-02-20 19:58:16 UTC) #2
msw
https://codereview.chromium.org/174253002/diff/1/chrome/app/chrome_main_delegate.cc File chrome/app/chrome_main_delegate.cc (right): https://codereview.chromium.org/174253002/diff/1/chrome/app/chrome_main_delegate.cc#newcode584 chrome/app/chrome_main_delegate.cc:584: chrome::GetUserDataDir(content::MainFunctionParams(command_line)); On 2014/02/20 19:58:17, Vitaly Buka wrote: > Should ...
6 years, 10 months ago (2014-02-20 20:58:47 UTC) #3
Vitaly Buka (NO REVIEWS)
On 2014/02/20 20:58:47, msw wrote: > https://codereview.chromium.org/174253002/diff/1/chrome/app/chrome_main_delegate.cc > File chrome/app/chrome_main_delegate.cc (right): > > https://codereview.chromium.org/174253002/diff/1/chrome/app/chrome_main_delegate.cc#newcode584 > ...
6 years, 10 months ago (2014-02-20 21:25:24 UTC) #4
Vitaly Buka (NO REVIEWS)
On 2014/02/20 21:25:24, Vitaly Buka wrote: > On 2014/02/20 20:58:47, msw wrote: > > > ...
6 years, 10 months ago (2014-02-20 21:26:11 UTC) #5
Vitaly Buka (NO REVIEWS)
lgtm https://codereview.chromium.org/174253002/diff/100001/chrome/browser/user_data_dir_extractor.cc File chrome/browser/user_data_dir_extractor.cc (right): https://codereview.chromium.org/174253002/diff/100001/chrome/browser/user_data_dir_extractor.cc#newcode112 chrome/browser/user_data_dir_extractor.cc:112: CommandLine::ForCurrentProcess()->AppendSwitchPath(switches::kUserDataDir, actually you just did that
6 years, 10 months ago (2014-02-20 21:28:04 UTC) #6
Vitaly Buka (NO REVIEWS)
On 2014/02/20 21:28:04, Vitaly Buka wrote: > lgtm > > https://codereview.chromium.org/174253002/diff/100001/chrome/browser/user_data_dir_extractor.cc > File chrome/browser/user_data_dir_extractor.cc (right): ...
6 years, 10 months ago (2014-02-20 21:31:32 UTC) #7
msw
On 2014/02/20 21:31:32, Vitaly Buka wrote: > We still have the issue windows service runs: ...
6 years, 10 months ago (2014-02-20 21:48:33 UTC) #8
Vitaly Buka (NO REVIEWS)
On 2014/02/20 21:48:33, msw wrote: > On 2014/02/20 21:31:32, Vitaly Buka wrote: > > We ...
6 years, 10 months ago (2014-02-20 21:56:53 UTC) #9
sky
LGTM
6 years, 10 months ago (2014-02-20 22:38:58 UTC) #10
msw
Please take another look; I revised the init/warn approach.
6 years, 10 months ago (2014-02-21 22:54:30 UTC) #11
Vitaly Buka (NO REVIEWS)
lgtm lgtm with https://codereview.chromium.org/174253002/diff/460001/chrome/app/chrome_main_delegate.cc File chrome/app/chrome_main_delegate.cc (right): https://codereview.chromium.org/174253002/diff/460001/chrome/app/chrome_main_delegate.cc#newcode583 chrome/app/chrome_main_delegate.cc:583: switches::InitializeUserDataDir(); Maybe note about logging too? ...
6 years, 10 months ago (2014-02-21 23:11:33 UTC) #12
msw
Shoot, I'm getting a check_deps failure: http://build.chromium.org/p/tryserver.chromium/builders/linux_rel/builds/231631/steps/check_deps/logs/stdio ERROR in src/chrome/common/switch_utils.cc Illegal include: "chrome/browser/policy/policy_path_parser.h" Because of ...
6 years, 10 months ago (2014-02-21 23:38:30 UTC) #13
msw
Please take a look; the latest patch set should work.
6 years, 10 months ago (2014-02-22 00:15:03 UTC) #14
Vitaly Buka (NO REVIEWS)
lgtm with CHECK->DCHECK https://codereview.chromium.org/174253002/diff/660001/chrome/common/chrome_paths.cc File chrome/common/chrome_paths.cc (right): https://codereview.chromium.org/174253002/diff/660001/chrome/common/chrome_paths.cc#newcode164 chrome/common/chrome_paths.cc:164: CHECK(g_user_data_dir_initialized); DCHECK is safer here. We ...
6 years, 10 months ago (2014-02-22 00:27:08 UTC) #15
Vitaly Buka (NO REVIEWS)
On 2014/02/22 00:27:08, Vitaly Buka wrote: > lgtm with CHECK->DCHECK > > https://codereview.chromium.org/174253002/diff/660001/chrome/common/chrome_paths.cc > File ...
6 years, 10 months ago (2014-02-22 00:28:00 UTC) #16
msw
https://codereview.chromium.org/174253002/diff/660001/chrome/common/chrome_paths.cc File chrome/common/chrome_paths.cc (right): https://codereview.chromium.org/174253002/diff/660001/chrome/common/chrome_paths.cc#newcode164 chrome/common/chrome_paths.cc:164: CHECK(g_user_data_dir_initialized); On 2014/02/22 00:27:09, Vitaly Buka wrote: > DCHECK ...
6 years, 10 months ago (2014-02-22 00:42:07 UTC) #17
sky
LGTM
6 years, 10 months ago (2014-02-24 14:26:06 UTC) #18
msw
The CQ bit was checked by msw@chromium.org
6 years, 10 months ago (2014-02-24 15:14:07 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/930001
6 years, 10 months ago (2014-02-24 15:14:15 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/930001
6 years, 10 months ago (2014-02-24 20:19:16 UTC) #21
msw
The CQ bit was checked by msw@chromium.org
6 years, 10 months ago (2014-02-24 21:44:56 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160001
6 years, 10 months ago (2014-02-24 21:46:50 UTC) #23
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-25 00:10:24 UTC) #24
commit-bot: I haz the power
Retried try job too often on win for step(s) compile http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win&number=152576
6 years, 10 months ago (2014-02-25 00:10:25 UTC) #25
msw
The CQ bit was checked by msw@chromium.org
6 years, 10 months ago (2014-02-25 00:10:51 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160001
6 years, 10 months ago (2014-02-25 00:15:30 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160001
6 years, 10 months ago (2014-02-25 01:46:50 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-25 05:06:35 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel
6 years, 10 months ago (2014-02-25 05:06:35 UTC) #30
Vitaly Buka (NO REVIEWS)
The CQ bit was checked by vitalybuka@chromium.org
6 years, 10 months ago (2014-02-25 05:22:23 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160001
6 years, 10 months ago (2014-02-25 05:26:42 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-25 05:29:59 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel
6 years, 10 months ago (2014-02-25 05:29:59 UTC) #34
msw
The CQ bit was checked by msw@chromium.org
6 years, 10 months ago (2014-02-25 06:15:58 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160001
6 years, 10 months ago (2014-02-25 06:46:03 UTC) #36
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-25 06:54:46 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel
6 years, 10 months ago (2014-02-25 06:54:47 UTC) #38
msw
The CQ bit was checked by msw@chromium.org
6 years, 10 months ago (2014-02-25 16:09:40 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160001
6 years, 10 months ago (2014-02-25 16:10:29 UTC) #40
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-25 16:11:22 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel
6 years, 10 months ago (2014-02-25 16:11:23 UTC) #42
Vitaly Buka (NO REVIEWS)
The CQ bit was checked by vitalybuka@chromium.org
6 years, 10 months ago (2014-02-25 19:29:37 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160001
6 years, 10 months ago (2014-02-25 19:29:58 UTC) #44
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-25 19:32:43 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel
6 years, 10 months ago (2014-02-25 19:32:44 UTC) #46
Vitaly Buka (NO REVIEWS)
The CQ bit was checked by vitalybuka@chromium.org
6 years, 10 months ago (2014-02-25 19:34:06 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160001
6 years, 10 months ago (2014-02-25 19:35:38 UTC) #48
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-25 19:37:26 UTC) #49
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel
6 years, 10 months ago (2014-02-25 19:37:27 UTC) #50
Vitaly Buka (NO REVIEWS)
The CQ bit was checked by vitalybuka@chromium.org
6 years, 10 months ago (2014-02-25 22:46:58 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160001
6 years, 10 months ago (2014-02-25 22:57:10 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160001
6 years, 10 months ago (2014-02-25 23:53:30 UTC) #53
Vitaly Buka (NO REVIEWS)
On 2014/02/25 23:53:30, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
6 years, 10 months ago (2014-02-26 00:09:55 UTC) #54
Vitaly Buka (NO REVIEWS)
The CQ bit was unchecked by vitalybuka@chromium.org
6 years, 10 months ago (2014-02-26 00:10:15 UTC) #55
Vitaly Buka (NO REVIEWS)
The CQ bit was checked by vitalybuka@chromium.org
6 years, 10 months ago (2014-02-26 00:10:23 UTC) #56
Vitaly Buka (NO REVIEWS)
The CQ bit was unchecked by vitalybuka@chromium.org
6 years, 10 months ago (2014-02-26 01:45:25 UTC) #57
Vitaly Buka (NO REVIEWS)
there is a real linking error https://codereview.chromium.org/174253002/diff/1160001/chrome/common/chrome_paths.cc File chrome/common/chrome_paths.cc (right): https://codereview.chromium.org/174253002/diff/1160001/chrome/common/chrome_paths.cc#newcode98 chrome/common/chrome_paths.cc:98: static base::LazyInstance<base::FilePath> Needs ...
6 years, 10 months ago (2014-02-26 01:50:23 UTC) #58
msw
https://codereview.chromium.org/174253002/diff/1160001/chrome/common/chrome_paths.cc File chrome/common/chrome_paths.cc (right): https://codereview.chromium.org/174253002/diff/1160001/chrome/common/chrome_paths.cc#newcode98 chrome/common/chrome_paths.cc:98: static base::LazyInstance<base::FilePath> On 2014/02/26 01:50:24, Vitaly Buka wrote: > ...
6 years, 9 months ago (2014-02-26 20:34:27 UTC) #59
msw
The CQ bit was checked by msw@chromium.org
6 years, 9 months ago (2014-02-26 20:34:33 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1180001
6 years, 9 months ago (2014-02-26 20:37:08 UTC) #61
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-02-26 22:56:42 UTC) #62
commit-bot: I haz the power
Retried try job too often on win for step(s) compile http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win&number=153423
6 years, 9 months ago (2014-02-26 22:56:43 UTC) #63
msw
The CQ bit was checked by msw@chromium.org
6 years, 9 months ago (2014-02-26 23:16:44 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1160002
6 years, 9 months ago (2014-02-26 23:19:47 UTC) #65
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-02-27 02:34:25 UTC) #66
commit-bot: I haz the power
Retried try job too often on win for step(s) compile http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win&number=153525
6 years, 9 months ago (2014-02-27 02:34:26 UTC) #67
msw
The CQ bit was checked by msw@chromium.org
6 years, 9 months ago (2014-02-27 02:41:35 UTC) #68
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1210001
6 years, 9 months ago (2014-02-27 02:44:25 UTC) #69
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-02-27 08:26:42 UTC) #70
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel
6 years, 9 months ago (2014-02-27 08:26:43 UTC) #71
Vitaly Buka (NO REVIEWS)
The CQ bit was checked by vitalybuka@chromium.org
6 years, 9 months ago (2014-02-27 08:27:47 UTC) #72
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/174253002/1210001
6 years, 9 months ago (2014-02-27 08:28:04 UTC) #73
commit-bot: I haz the power
6 years, 9 months ago (2014-02-27 14:20:00 UTC) #74
Message was sent while issue was closed.
Change committed as 253803

Powered by Google App Engine
This is Rietveld 408576698