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

Issue 2441: implement things needed to run net/disk_cache/backend_unittest (Closed)

Created:
12 years, 3 months ago by please use my chromium address
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

implement things needed to run unittests of disk_cache backend

Patch Set 1 #

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -4 lines) Patch
M base/file_util.h View 2 chunks +6 lines, -0 lines 0 comments Download
M base/file_util_linux.cc View 1 2 chunks +46 lines, -0 lines 0 comments Download
M base/file_util_unittest.cc View 1 2 chunks +2 lines, -3 lines 0 comments Download
M net/SConscript View 1 2 chunks +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
please use my chromium address
After this net_unittests run 216 tests on Linux (previously: 180). Hopefully I guessed reviewers correctly.
12 years, 3 months ago (2008-09-11 19:34:39 UTC) #1
Mark Mentovai
http://codereview.chromium.org/2441/diff/1/4 File base/file_util_linux.cc (right): http://codereview.chromium.org/2441/diff/1/4#newcode74 Line 74: bool CopyDirectory(const std::wstring& from_path, const std::wstring& to_path, It's ...
12 years, 3 months ago (2008-09-11 20:27:06 UTC) #2
please use my chromium address
On 2008/09/11 20:27:06, Mark Mentovai wrote: > http://codereview.chromium.org/2441/diff/1/4 > File base/file_util_linux.cc (right): > > http://codereview.chromium.org/2441/diff/1/4#newcode74 ...
12 years, 3 months ago (2008-09-12 15:45:40 UTC) #3
Erik does not do reviews
Unfortunately, there's one big gotcha in this implementation. The header file doesn't specify this (sigh), ...
12 years, 3 months ago (2008-09-12 16:20:02 UTC) #4
rvargas (doing something else)
12 years, 3 months ago (2008-09-15 17:44:17 UTC) #5
Actually, there is a comment on the header warning users against using wildcard
characters when using this API. At some point I fixed all calls that were using
wildcards so fixing new ones (if any) should be easy.

Maybe we could add code on debug mode to verify this if we want to prevent
further appearances of that pattern.

As a somewhat related note, it would be nice if all implementations do  more or
less the same thing regarding metadata. As far as I remember, the windows
implementation copies as much metadata as reasonable: the result of a copy is
after all a new file, so the owner (and security related) information of the new
file reflects the user that is actually performing the copy (as opposed to a
move operation, when all security info is preserved).

On 2008/09/12 16:20:02, Erik Kay wrote:
> Unfortunately, there's one big gotcha in this implementation.  The header file
> doesn't specify this (sigh), but the Windows version of the code uses
> SHFileOperation which supports MS-DOS wildcards in the filename position of
> from_path:
> http://msdn.microsoft.com/en-us/library/bb759795(VS.85).aspx
> "Standard Microsoft MS-DOS wildcard characters, such as "*", are permitted
only
> in the file-name position. Using a wildcard character elsewhere in the string
> will lead to unpredictable results."
> 
> Also unfortunately, at least some of our code depends on this behavior (see
> chrome/browser/importer_unittest.cc - although this one is dumb and can be
> removed).
> 
> Of course all of this is made worse by the fact that file_util_unittest.cc
> doesn't exercise this behavior itself.
> 
> We have a couple of options here:
> (1) Fully support the behavior of the windows platform as-is on Linux and Mac.

> Extend the unit tests to exercise this, update the header files for clarity.
> (2) Track down the users of CopyDirectory, remove any use of wildcards and
> change the Windows impl to detect wildcards and return an error if they're
used
> (there doesn't appear to be a flag to SHFileOperation to enforce this, so we'd
> have to manually check).
> 
> (1) doesn't look particularly hard, but I'm not convinced we want / need to
> support this feature in the API.
> (2) might not be that bad either since it looks like there aren't that many
> consumers of the API.  However, it would definitely require a fair amount of
> testing to convince ourselves that we didn't break anything.
> 
> Opinions?

Powered by Google App Engine
This is Rietveld 408576698