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

Issue 2924433002: Change linux default hidden file save directory to XDG_DATA_HOME (Closed)

Created:
3 years, 6 months ago by Tom Anderson
Modified:
3 years, 6 months ago
CC:
chromium-reviews, David Trainor- moved to gerrit
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Change linux default hidden file save directory to XDG_DATA_HOME Versions of GTK3 up to 3.14.7 had a bug that would cause a segfault when a GtkFileChooser was open and a hidden file in the directory was deleted [1]. Chrome can trigger this bug in the following scenario: 1. Open 2 windows 2. Open a save dialog in each window 3. Close one of the dialogs Chrome saves a file in two stages: it writes the contents to a hidden file, and then renames it to the actual file. This is so the file can be downloading as the user is choosing a file to save to. By default, the hidden file is placed into whichever directory the save dialog opens with. In the case of 2 save dialogs open at once, if the user saves the file (renames the hidden file) or cancels the download (deletes the hidden file), the GTK bug would be triggered. This CL changes the default directory for the hidden files to XDG_DATA_HOME in an effort to make triggering the GTK bug far less likely. [1] https://mail.gnome.org/archives/commits-list/2014-December/msg02447.html BUG=728501 R=thestig@chromium.org TBR=qinmin@chromium.org Review-Url: https://codereview.chromium.org/2924433002 Cr-Commit-Position: refs/heads/master@{#479213} Committed: https://chromium.googlesource.com/chromium/src/+/1799a1223112af65e44eba61dc4feb885389bfe2

Patch Set 1 #

Patch Set 2 : Use /var/tmp #

Total comments: 2

Patch Set 3 : Use XDG_CONFIG_HOME #

Total comments: 4

Patch Set 4 : Move override to download_manager_impl #

Patch Set 5 : Fix DownloadManagerTest.StartDownload #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -3 lines) Patch
M chrome/browser/shell_integration_linux.h View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/shell_integration_linux.cc View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 3 chunks +19 lines, -0 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 73 (47 generated)
Tom Anderson
thestig ptal
3 years, 6 months ago (2017-06-03 01:49:21 UTC) #2
Tom Anderson
Hm.. I just realized. What if /tmp is memory-mounted and the user is trying to ...
3 years, 6 months ago (2017-06-03 01:55:42 UTC) #4
Tom Anderson
On 2017/06/03 01:55:42, Tom Anderson wrote: > Hm.. I just realized. What if /tmp is ...
3 years, 6 months ago (2017-06-03 01:58:31 UTC) #5
Lei Zhang
I'd ask the download folks about this. From my understanding, we ideally want the hidden ...
3 years, 6 months ago (2017-06-06 21:18:50 UTC) #19
Tom Anderson
On 2017/06/06 21:18:50, Lei Zhang wrote: > I'd ask the download folks about this. From ...
3 years, 6 months ago (2017-06-06 21:27:39 UTC) #21
Tom Anderson
also +qinmin
3 years, 6 months ago (2017-06-06 21:28:23 UTC) #23
qinmin
https://codereview.chromium.org/2924433002/diff/20001/chrome/browser/download/chrome_download_manager_delegate.cc File chrome/browser/download/chrome_download_manager_delegate.cc (right): https://codereview.chromium.org/2924433002/diff/20001/chrome/browser/download/chrome_download_manager_delegate.cc#newcode462 chrome/browser/download/chrome_download_manager_delegate.cc:462: *download_save_dir = base::FilePath(kVarTmp); Shouldn't this be done in download_prefs_? ...
3 years, 6 months ago (2017-06-06 22:10:14 UTC) #24
qinmin
3 years, 6 months ago (2017-06-06 22:10:14 UTC) #25
Tom Anderson
I think XDG_DATA_HOME (~/.local/share) is the right path to use here. It's usually on the ...
3 years, 6 months ago (2017-06-07 01:29:51 UTC) #27
David Trainor- moved to gerrit
Moving myself to CC since I'm still out for the next day. Thanks Min!
3 years, 6 months ago (2017-06-07 06:11:34 UTC) #33
Lei Zhang
lgtm with approval from the downloads folks. https://codereview.chromium.org/2924433002/diff/40001/chrome/browser/shell_integration_linux.cc File chrome/browser/shell_integration_linux.cc (left): https://codereview.chromium.org/2924433002/diff/40001/chrome/browser/shell_integration_linux.cc#oldcode565 chrome/browser/shell_integration_linux.cc:565: base::ThreadRestrictions::AssertIOAllowed(); Comment ...
3 years, 6 months ago (2017-06-07 06:48:33 UTC) #34
qinmin
https://codereview.chromium.org/2924433002/diff/40001/chrome/browser/download/download_prefs.cc File chrome/browser/download/download_prefs.cc (right): https://codereview.chromium.org/2924433002/diff/40001/chrome/browser/download/download_prefs.cc#newcode263 chrome/browser/download/download_prefs.cc:263: // TODO(thomasanderson): Remove this when all Linux distros with ...
3 years, 6 months ago (2017-06-07 14:21:18 UTC) #35
Tom Anderson
https://codereview.chromium.org/2924433002/diff/40001/chrome/browser/download/download_prefs.cc File chrome/browser/download/download_prefs.cc (right): https://codereview.chromium.org/2924433002/diff/40001/chrome/browser/download/download_prefs.cc#newcode263 chrome/browser/download/download_prefs.cc:263: // TODO(thomasanderson): Remove this when all Linux distros with ...
3 years, 6 months ago (2017-06-07 18:38:38 UTC) #36
Tom Anderson
qinmin: I don't know where to put the new linux-specific override. I'm not sure download_prefs ...
3 years, 6 months ago (2017-06-07 20:38:58 UTC) #44
qinmin
On 2017/06/07 20:38:58, Tom Anderson wrote: > qinmin: I don't know where to put the ...
3 years, 6 months ago (2017-06-07 21:13:20 UTC) #45
Tom Anderson
On 2017/06/07 21:13:20, qinmin wrote: > On 2017/06/07 20:38:58, Tom Anderson wrote: > > qinmin: ...
3 years, 6 months ago (2017-06-08 00:05:04 UTC) #46
qinmin
On 2017/06/08 00:05:04, Tom Anderson wrote: > On 2017/06/07 21:13:20, qinmin wrote: > > On ...
3 years, 6 months ago (2017-06-08 07:17:00 UTC) #47
Tom Anderson
On 2017/06/08 07:17:00, qinmin wrote: > On 2017/06/08 00:05:04, Tom Anderson wrote: > > I'm ...
3 years, 6 months ago (2017-06-08 18:40:42 UTC) #48
Lei Zhang
On 2017/06/08 18:40:42, Tom Anderson wrote: > Lei FYI: the latest patchset moves the override ...
3 years, 6 months ago (2017-06-08 21:00:32 UTC) #56
Tom Anderson
Pinging qinmin and/or dtrainor On 2017/06/08 21:00:32, Lei Zhang wrote: > On 2017/06/08 18:40:42, Tom ...
3 years, 6 months ago (2017-06-13 18:13:43 UTC) #59
Min Qin
lgtm
3 years, 6 months ago (2017-06-13 18:19:38 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2924433002/120001
3 years, 6 months ago (2017-06-13 20:29:20 UTC) #64
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/462900)
3 years, 6 months ago (2017-06-13 20:41:43 UTC) #66
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2924433002/120001
3 years, 6 months ago (2017-06-13 23:54:17 UTC) #69
Tom Anderson
On 2017/06/13 20:41:43, commit-bot: I haz the power wrote: > Try jobs failed on following ...
3 years, 6 months ago (2017-06-13 23:56:47 UTC) #70
commit-bot: I haz the power
3 years, 6 months ago (2017-06-14 00:02:16 UTC) #73
Message was sent while issue was closed.
Committed patchset #5 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/1799a1223112af65e44eba61dc4f...

Powered by Google App Engine
This is Rietveld 408576698