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

Issue 1763008: Windows: Make file_util::Delete("c:\\foo_dir", false) work correctly. Add more unit tests for Delete (Closed)

Created:
10 years, 8 months ago by Lei Zhang
Modified:
9 years, 7 months ago
CC:
chromium-reviews, brettw-cc_chromium.org
Visibility:
Public.

Description

Windows: Make file_util::Delete("c:\\foo_dir", false) work correctly. Add more unit tests for Delete. BUG=42374 TEST=included Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=46633

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Total comments: 2

Patch Set 3 : fix installer tests #

Patch Set 4 : '' #

Patch Set 5 : Look for wildcards and use PathExists #

Patch Set 6 : re-upload patch set 4 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -29 lines) Patch
M base/file_util_unittest.cc View 2 3 4 5 2 chunks +125 lines, -13 lines 0 comments Download
M base/file_util_win.cc View 1 2 3 4 5 3 chunks +18 lines, -9 lines 0 comments Download
M chrome/installer/util/copy_tree_work_item_unittest.cc View 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/util/create_dir_work_item_unittest.cc View 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/util/delete_tree_work_item_unittest.cc View 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/util/helper_unittest.cc View 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/util/lzma_util_unittest.cc View 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/util/move_tree_work_item_unittest.cc View 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/util/shell_util_unittest.cc View 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 16 (0 generated)
Scott Hess - ex-Googler
drive-by http://codereview.chromium.org/1763008/diff/1/2 File base/file_util_win.cc (right): http://codereview.chromium.org/1763008/diff/1/2#newcode83 base/file_util_win.cc:83: } The final return in this code makes ...
10 years, 8 months ago (2010-04-23 05:05:10 UTC) #1
darin (slow to review)
http://codereview.chromium.org/1763008/diff/1/2 File base/file_util_win.cc (right): http://codereview.chromium.org/1763008/diff/1/2#newcode83 base/file_util_win.cc:83: } On 2010/04/23 05:05:11, shess wrote: > The final ...
10 years, 8 months ago (2010-04-23 06:50:40 UTC) #2
Lei Zhang
I am doing a bit of TDD right now. It looks I have some reviewers ...
10 years, 8 months ago (2010-04-23 06:53:22 UTC) #3
Lei Zhang
Please take a look. It's getting a bit late, so read carefully.
10 years, 8 months ago (2010-04-23 08:06:18 UTC) #4
Scott Hess - ex-Googler
LGTM, I think. http://codereview.chromium.org/1763008/diff/6001/7002 File base/file_util_unittest.cc (right): http://codereview.chromium.org/1763008/diff/6001/7002#newcode472 base/file_util_unittest.cc:472: // Create a subdirectory and put ...
10 years, 8 months ago (2010-04-23 16:17:16 UTC) #5
Lei Zhang
Typos fixed in patch set 3. The Windows try job for patch set 2 actually ...
10 years, 8 months ago (2010-04-23 23:07:23 UTC) #6
Scott Hess - ex-Googler
Still LGTM. Even though the Windows trybot's redness all looks grd related, it would still ...
10 years, 8 months ago (2010-04-24 15:34:15 UTC) #7
Lei Zhang
On 2010/04/24 15:34:15, shess wrote: > Still LGTM. > > Even though the Windows trybot's ...
10 years, 8 months ago (2010-04-28 00:29:23 UTC) #8
Scott Hess - ex-Googler
OK, so I noticed something like this when I was writing some code that did ...
10 years, 8 months ago (2010-04-28 03:09:43 UTC) #9
Lei Zhang
On 2010/04/28 03:09:43, shess wrote: > OK, so I noticed something like this when I ...
10 years, 8 months ago (2010-04-28 08:28:33 UTC) #10
Scott Hess - ex-Googler
LGTM. I want to say to put the 0x402 as a kUnknownError constant, with the ...
10 years, 8 months ago (2010-04-28 21:36:26 UTC) #11
Scott Hess - ex-Googler
BTW: http://www.pc-library.com/errors/error-code/1026-0x402/ Makes it sound like this doesn't always mean that the file doesn't exist. ...
10 years, 8 months ago (2010-04-28 21:42:25 UTC) #12
Lei Zhang
Ok, patch set 5 tries something different: Use file_util::PathExists to check for existence first. Of ...
10 years, 7 months ago (2010-04-30 00:38:25 UTC) #13
Scott Hess - ex-Googler
Crap. I like the earlier solution with the magic constant better, at least we knew ...
10 years, 7 months ago (2010-04-30 13:50:48 UTC) #14
Lei Zhang
On 2010/04/30 13:50:48, shess wrote: > Crap. I like the earlier solution with the magic ...
10 years, 7 months ago (2010-05-06 00:56:43 UTC) #15
Scott Hess - ex-Googler
10 years, 7 months ago (2010-05-06 05:01:48 UTC) #16
AFAICT patch 4 is "Check for an essentially undocumented error code",
in which case Still LGTM.

On Wed, May 5, 2010 at 5:56 PM,  <thestig@chromium.org> wrote:
> On 2010/04/30 13:50:48, shess wrote:
>>
>> Crap.  I like the earlier solution with the magic constant better, at
>> least we knew for certain that things were already failing.  My worry
>> was that since 0x402 seems to imply "Something bad happened", maybe it
>> allowed for cases where the file DID exist and wasn't actually deleted
>> for some reason.
>
>> Does anyone in Chrome actually use wildcards, since it's not supported on
>
> POSIX?
>
>> Replacing the last line of the function with:
>>   return !PathExists(path);
>> be reasonable?  Hmm, no, because of the wildcard problem.
>
>> OK.  I'm leaning towards magic constant, and hope for the best.  We
>> can probably assume that any bad cases let through by 0x402 will
>> anyhow cause all sorts of non-recoverable stuff to happen.  I just
>> wish it was clearer why we get this inconsistently.  A race condition
>> with the parent directory being deleted?  Trybot flakiness?
>
> On second thought, I think patch set 4 is better in the long run. Overtime
> as
> people move away from XP, the 0x402 will stop occurring. And yes, do we have
> the
> win32 installer utils which pass in wildcards.  I think you've LGTMed this
> CL
> several times already, so I will go ahead and commit patch set 4 tomorrow
> morning unless I hear objections.
>
> http://codereview.chromium.org/1763008/show
>

Powered by Google App Engine
This is Rietveld 408576698