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

Issue 437090: Fix race in directory creation on Windows. The... (Closed)

Created:
11 years ago by Jói
Modified:
9 years, 7 months ago
Reviewers:
M-A Ruel
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org
Visibility:
Public.

Description

Fix race in directory creation on Windows. The file_util::CreateDirectory() function is supposed to succeed if the directory already exists, but in the previous implementation when two processes/threads called the function at the same time for the same path, one would see a failure. Also, get rid of the use of SHCreateDirectoryEx function. For one, it is highly serializing because it calls SHChangeNotify. The race was actually easy to reproduce by starting two instances of Chrome both at the same time, with a profile directory flag indicating a profile directory that did not previously exist. For another, SHCreateDirectoryEx would fail with ERROR_CANCELLED if any of the path components were not visible, according to its MSDN documentation. BUG=none TEST=[base_unittests.exe --gtest_filter=*CreateDirectory* ], and/or install Chrome Frame on a fresh machine and make sure the first page you navigate to has two Chrome Frame instances on it - you should get no DCHECK on failure of PathService::Override Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=33225

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -3 lines) Patch
M base/file_util_unittest.cc View 1 chunk +17 lines, -0 lines 0 comments Download
M base/file_util_win.cc View 1 1 chunk +38 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Jói
11 years ago (2009-11-26 20:02:26 UTC) #1
M-A Ruel
barely lgtm. :) I'd rather see a CL removing the use of this function altogether. ...
11 years ago (2009-11-26 20:32:10 UTC) #2
Jói
Oh man, I thought you might say that :) OK, will do, was trying not ...
11 years ago (2009-11-26 20:46:07 UTC) #3
Jói
Please take another look. Thanks for asking me to do the right thing, it wasn't ...
11 years ago (2009-11-26 21:32:08 UTC) #4
M-A Ruel
11 years ago (2009-11-26 21:38:45 UTC) #5
I knew you were able to. lgtm

Powered by Google App Engine
This is Rietveld 408576698