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

Issue 15861011: Add an "append flag" to base::PlatformFile. (Closed)

Created:
7 years, 7 months ago by teravest
Modified:
7 years, 6 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, sail+watch_chromium.org, Yusuke Sato
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Add an "append flag" to base::PlatformFile. PLATFORM_FILE_APPEND is exclusive with PLATFORM_FILE_WRITE. This is because on Windows, if we were to apply both flags, the behavior would not be consistent with O_APPEND. On Posix, PLATFORM_FILE_APPEND provides O_APPEND, and either O_WRONLY or O_RDWR, depending on other flags. On Windows, PLATFORM_FILE_APPEND provides FILE_APPEND_DATA, and fails to create the plaform file if PLATFORM_FILE_WRITE is also passed. BUG=242383 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=205217

Patch Set 1 #

Patch Set 2 : windows fix attempt #

Patch Set 3 : Remove unnecessary braces #

Total comments: 2

Patch Set 4 : Fix case when a file is opened with append, but not read. #

Total comments: 7

Patch Set 5 : Style, reorder enum #

Total comments: 2

Patch Set 6 : Indentation style, missing semicolon #

Total comments: 1

Patch Set 7 : Fix formatting nit #

Patch Set 8 : Make test stricter #

Patch Set 9 : Make test stricter #

Patch Set 10 : Disallow WritePlatformFile() for PLATFORM_FILE_APPEND #

Patch Set 11 : Ignore write offset when PLATFORM_FILE_APPEND. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+132 lines, -48 lines) Patch
M base/platform_file.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +17 lines, -12 lines 0 comments Download
M base/platform_file_posix.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -0 lines 0 comments Download
M base/platform_file_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 chunks +97 lines, -34 lines 0 comments Download
M base/platform_file_win.cc View 1 2 3 4 5 1 chunk +8 lines, -2 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
teravest
7 years, 6 months ago (2013-05-28 14:04:52 UTC) #1
teravest
7 years, 6 months ago (2013-05-31 15:48:29 UTC) #2
jar (doing other things)
Drive by question... https://codereview.chromium.org/15861011/diff/6001/base/platform_file_posix.cc File base/platform_file_posix.cc (right): https://codereview.chromium.org/15861011/diff/6001/base/platform_file_posix.cc#newcode84 base/platform_file_posix.cc:84: !(flags & PLATFORM_FILE_OPEN_ALWAYS)) { Are some ...
7 years, 6 months ago (2013-05-31 16:33:50 UTC) #3
teravest
https://codereview.chromium.org/15861011/diff/6001/base/platform_file_posix.cc File base/platform_file_posix.cc (right): https://codereview.chromium.org/15861011/diff/6001/base/platform_file_posix.cc#newcode84 base/platform_file_posix.cc:84: !(flags & PLATFORM_FILE_OPEN_ALWAYS)) { On 2013/05/31 16:33:50, jar wrote: ...
7 years, 6 months ago (2013-05-31 17:04:08 UTC) #4
teravest
Hi Jim, Could you take another look at this?
7 years, 6 months ago (2013-06-03 20:47:42 UTC) #5
jar (doing other things)
https://codereview.chromium.org/15861011/diff/12001/base/platform_file.h File base/platform_file.h (right): https://codereview.chromium.org/15861011/diff/12001/base/platform_file.h#newcode22 base/platform_file.h:22: // PLATFORM_FILE_(OPEN|CREATE).* are mutually exclusive. You should specify nit: ...
7 years, 6 months ago (2013-06-04 23:31:50 UTC) #6
teravest
On Tue, Jun 4, 2013 at 5:31 PM, <jar@chromium.org> wrote: > > https://codereview.chromium.org/15861011/diff/12001/base/platform_file.h > File ...
7 years, 6 months ago (2013-06-05 15:43:43 UTC) #7
jar (doing other things)
https://codereview.chromium.org/15861011/diff/23001/base/platform_file_unittest.cc File base/platform_file_unittest.cc (right): https://codereview.chromium.org/15861011/diff/23001/base/platform_file_unittest.cc#newcode240 base/platform_file_unittest.cc:240: base::PLATFORM_FILE_APPEND, Yes... this is exactly what I was asking ...
7 years, 6 months ago (2013-06-05 16:39:21 UTC) #8
teravest
On Wed, Jun 5, 2013 at 10:39 AM, <jar@chromium.org> wrote: > > https://codereview.chromium.org/15861011/diff/23001/base/platform_file_unittest.cc > File ...
7 years, 6 months ago (2013-06-05 16:44:16 UTC) #9
jar (doing other things)
Thank you for smoothing out the formatting in that file!!! LGTM (with one missing nit) ...
7 years, 6 months ago (2013-06-06 15:46:45 UTC) #10
teravest
On Thu, Jun 6, 2013 at 9:46 AM, <jar@chromium.org> wrote: > Thank you for smoothing ...
7 years, 6 months ago (2013-06-06 15:50:18 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/teravest@chromium.org/15861011/30002
7 years, 6 months ago (2013-06-06 15:51:15 UTC) #12
commit-bot: I haz the power
Retried try job too often on ios_dbg_simulator for step(s) base_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=ios_dbg_simulator&number=58541
7 years, 6 months ago (2013-06-06 16:23:27 UTC) #13
teravest
I discovered one surprising behavior while testing this: For O_APPEND files, on Linux, pwrite() will ...
7 years, 6 months ago (2013-06-06 17:48:54 UTC) #14
teravest
I spent some time trying out what I wrote above, but it made PLATFORM_FILE_APPEND files ...
7 years, 6 months ago (2013-06-06 18:24:27 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/teravest@chromium.org/15861011/50002
7 years, 6 months ago (2013-06-07 19:42:40 UTC) #16
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=159827
7 years, 6 months ago (2013-06-07 23:11:54 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/teravest@chromium.org/15861011/50002
7 years, 6 months ago (2013-06-10 13:49:09 UTC) #18
commit-bot: I haz the power
7 years, 6 months ago (2013-06-10 15:28:16 UTC) #19
Message was sent while issue was closed.
Change committed as 205217

Powered by Google App Engine
This is Rietveld 408576698