DescriptionOnly support seeking file streams from the beginning of the file.
On Windows file streams are backed by files opened for overlapped I/O.
In this mode SetFilePointerEx (used for seeking) will return a write-
protected media error if the file is on write-protected media. This is
even if the file is opened read-only! Since no code (except for the
FileStream tests) calls Seek with anything other than File::FROM_BEGIN
it is simplest to simply remove this capability. That way we can update
the offset in the FileStream context's overlapped structure without
going through a call to Windows.
BUG=478227
Committed: https://crrev.com/aa435e70c70364430093361b5b8c460831f80bb4
Cr-Commit-Position: refs/heads/master@{#334518}
Patch Set 1 : #
Total comments: 1
Patch Set 2 : Prevent file_ from leaking out and DCHECK that async I/O is supported. #Patch Set 3 : Allow files built from native file handles to be marked async. #Patch Set 4 : One more instance where files need to be tagged as async. #
Total comments: 2
Patch Set 5 : Use static method instead of new constructor. #
Total comments: 1
Patch Set 6 : Add comment about ownership and "would be nice to check FLAG_OVERLAPPED". #
Total comments: 2
Patch Set 7 : Rebased. #
Total comments: 3
Patch Set 8 : Fix Win DBG build by Pass()-ing file out of CreateForAsyncHandle. #Messages
Total messages: 30 (7 generated)
|