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

Issue 19724: Properly honor base::SharedMemory semantics for name="" to mean... (Closed)

Created:
11 years, 10 months ago by John Grabowski
Modified:
9 years, 6 months ago
Reviewers:
brettw, agl, Amanda Walker
CC:
chromium-reviews_googlegroups.com, jeremy, Evan Martin, TVL
Visibility:
Public.

Description

Properly honor base::SharedMemory semantics for name="" to mean new/private shared memory on POSIX. Transition base::SharedMemory implementation to file/mmap() to prevent leaking of wired kernel resources and allow easier cleanup. Enable one more shared_memory unit test for POSIX. Enable stats_table_unittest.cc for Mac, and modify it so it cleans up.

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 12

Patch Set 9 : '' #

Total comments: 34

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Patch Set 15 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+390 lines, -57 lines) Patch
M base/base.xcodeproj/project.pbxproj View 1 2 3 4 7 8 9 5 chunks +5 lines, -1 line 0 comments Download
M base/file_util.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +12 lines, -0 lines 0 comments Download
M base/file_util_linux.cc View 11 12 1 chunk +5 lines, -0 lines 0 comments Download
M base/file_util_mac.mm View 1 chunk +4 lines, -0 lines 0 comments Download
M base/file_util_posix.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +48 lines, -14 lines 0 comments Download
M base/file_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +41 lines, -5 lines 0 comments Download
M base/file_util_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +20 lines, -0 lines 0 comments Download
M base/shared_memory.h View 1 2 3 4 5 6 7 8 4 chunks +16 lines, -1 line 0 comments Download
M base/shared_memory_posix.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +129 lines, -17 lines 0 comments Download
M base/shared_memory_unittest.cc View 1 2 3 4 5 6 7 8 7 chunks +80 lines, -4 lines 0 comments Download
M base/shared_memory_win.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M base/stats_table_unittest.cc View 7 12 chunks +24 lines, -5 lines 0 comments Download
M chrome/renderer/render_process.cc View 2 3 4 5 6 7 8 2 chunks +1 line, -10 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
John Grabowski
Amanda: please review for correctness, and that this is a reasonable direction for Mac. Evan: ...
11 years, 10 months ago (2009-01-31 04:00:14 UTC) #1
brettw
http://codereview.chromium.org/19724/diff/91/95 File base/file_util_posix.cc (right): http://codereview.chromium.org/19724/diff/91/95#newcode277 Line 277: int _CreateAndOpenFdForTemporaryFile(FilePath* path) { What are you trying ...
11 years, 10 months ago (2009-01-31 16:46:17 UTC) #2
John Grabowski
http://codereview.chromium.org/19724/diff/91/95 File base/file_util_posix.cc (right): http://codereview.chromium.org/19724/diff/91/95#newcode277 Line 277: int _CreateAndOpenFdForTemporaryFile(FilePath* path) { On 2009/01/31 16:46:17, brettw ...
11 years, 10 months ago (2009-02-01 05:58:45 UTC) #3
Evan Martin
swapping out myself with agl in reviewers agl's unix-fu > my unix-fu.
11 years, 10 months ago (2009-02-02 17:54:39 UTC) #4
Amanda Walker
Overall lgtm, though I'd lean towards trying out flock or lockf immediately instead of a ...
11 years, 10 months ago (2009-02-02 18:18:18 UTC) #5
agl
In the limit, we need to get rid of the whole idea of passing names ...
11 years, 10 months ago (2009-02-02 18:26:53 UTC) #6
John Grabowski
Verbal promise made to Amanda to follow-up wrt the semaphore transition. Performance tests warranted (e.g. ...
11 years, 10 months ago (2009-02-02 21:28:41 UTC) #7
agl
http://codereview.chromium.org/19724/diff/278/282 File base/file_util_posix.cc (right): http://codereview.chromium.org/19724/diff/278/282#newcode281 Line 281: *path = path->Append(kTempFileName); On 2009/02/02 21:28:41, John Grabowski ...
11 years, 10 months ago (2009-02-02 21:40:18 UTC) #8
John Grabowski
http://codereview.chromium.org/19724/diff/278/282 File base/file_util_posix.cc (right): http://codereview.chromium.org/19724/diff/278/282#newcode281 Line 281: *path = path->Append(kTempFileName); On 2009/02/02 21:40:18, agl wrote: ...
11 years, 10 months ago (2009-02-02 23:18:22 UTC) #9
agl
11 years, 10 months ago (2009-02-02 23:34:05 UTC) #10
LGTM

http://codereview.chromium.org/19724/diff/278/282
File base/file_util_posix.cc (right):

http://codereview.chromium.org/19724/diff/278/282#newcode281
Line 281: *path = path->Append(kTempFileName);
On 2009/02/02 23:18:22, John Grabowski wrote:
> 1. made it explicit by declaring tmpdir_string to be a reference.

"Made it explicit" suggests that it's a non-semantic change, but making it a
reference is a very semantically significant change.

I think the code is ok now. Submit as is is fine, although one can avoid a
const_cast by copying kTempFileName to a stack buffer, having mkstemp mutate
that and appending to @path.


AGL

Powered by Google App Engine
This is Rietveld 408576698