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

Issue 2845113005: Replace base::SharedMemory read-only methods with GetReadOnlyHandle. (Closed)

Created:
3 years, 7 months ago by erikchen
Modified:
3 years, 7 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, qsr+mojo_chromium.org, vmpstr+watch_chromium.org, viettrungluu+watch_chromium.org, jam, gavinp+memory_chromium.org, dcheng, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, yzshen+watch_chromium.org, asvitkine+watch_chromium.org, mac-reviews_chromium.org, chromium-apps-reviews_chromium.org, danakj+watch_chromium.org, darin (slow to review)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace base::SharedMemory read-only methods with GetReadOnlyHandle. This CL is a refactor with no intended behavior change. The previous methods ShareReadOnlyToProcess and GiveReadOnlyToProcess could be used to directly add a handle to the destination process, which is a bad practice. All callers already avoid doing this. The new method GetReadOnlyHandle returns a read-only handle in the current process which the IPC subsystem will transport into the destination process. BUG=716206 TBR=brettw@chromium.org Review-Url: https://codereview.chromium.org/2845113005 Cr-Commit-Position: refs/heads/master@{#468731} Committed: https://chromium.googlesource.com/chromium/src/+/c87903ecca1345c4363da94e0120adedd83963b0

Patch Set 1 #

Patch Set 2 : Fix. #

Patch Set 3 : minor fixes. #

Patch Set 4 : get rid of share mode. #

Patch Set 5 : Rebase. #

Patch Set 6 : clang format. #

Patch Set 7 : Fix android. #

Patch Set 8 : Fix error. #

Patch Set 9 : Rebase. #

Patch Set 10 : Rebase. #

Patch Set 11 : Rebase. #

Total comments: 6

Patch Set 12 : comments from jyasskin #

Total comments: 9

Patch Set 13 : Comments from thakis. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -180 lines) Patch
M base/memory/shared_memory.h View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +22 lines, -44 lines 0 comments Download
M base/memory/shared_memory_android.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M base/memory/shared_memory_helper.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/memory/shared_memory_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +26 lines, -52 lines 0 comments Download
M base/memory/shared_memory_mac_unittest.cc View 4 chunks +4 lines, -7 lines 0 comments Download
M base/memory/shared_memory_nacl.cc View 1 chunk +8 lines, -10 lines 0 comments Download
M base/memory/shared_memory_posix.cc View 1 2 3 4 5 6 7 6 chunks +20 lines, -43 lines 0 comments Download
M base/memory/shared_memory_unittest.cc View 2 chunks +3 lines, -4 lines 0 comments Download
M base/memory/shared_memory_win.cc View 1 2 3 1 chunk +15 lines, -3 lines 0 comments Download
M base/metrics/field_trial.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -4 lines 0 comments Download
M content/browser/renderer_host/clipboard_message_filter_unittest.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M extensions/browser/user_script_loader.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M mojo/edk/embedder/platform_shared_buffer.cc View 1 2 1 chunk +2 lines, -4 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 49 (38 generated)
erikchen
thakis: Please review
3 years, 7 months ago (2017-04-28 18:16:46 UTC) #13
erikchen
brettw: Please stamp everything not in base/. I plan on TBR-ing you haven't gotten to ...
3 years, 7 months ago (2017-04-29 21:46:41 UTC) #30
Nico
jyasskin, since this modifies an API you added a while ago, could you give this ...
3 years, 7 months ago (2017-04-30 22:33:54 UTC) #32
Jeffrey Yasskin
This would have been easier to read if the changes to migrate to the new ...
3 years, 7 months ago (2017-05-01 22:16:34 UTC) #33
erikchen
https://codereview.chromium.org/2845113005/diff/200001/base/memory/shared_memory_mac.cc File base/memory/shared_memory_mac.cc (left): https://codereview.chromium.org/2845113005/diff/200001/base/memory/shared_memory_mac.cc#oldcode292 base/memory/shared_memory_mac.cc:292: // We could imagine re-opening the file from /dev/fd, ...
3 years, 7 months ago (2017-05-02 01:53:08 UTC) #34
Nico
lgtm https://codereview.chromium.org/2845113005/diff/220001/base/memory/shared_memory.h File base/memory/shared_memory.h (right): https://codereview.chromium.org/2845113005/diff/220001/base/memory/shared_memory.h#newcode210 base/memory/shared_memory.h:210: // ownership of the handle. CHECK-fails if the ...
3 years, 7 months ago (2017-05-02 15:48:39 UTC) #39
Nico
https://codereview.chromium.org/2845113005/diff/220001/base/memory/shared_memory_win.cc File base/memory/shared_memory_win.cc (right): https://codereview.chromium.org/2845113005/diff/220001/base/memory/shared_memory_win.cc#newcode364 base/memory/shared_memory_win.cc:364: if (close_self) { On 2017/05/02 15:48:39, Nico wrote: > ...
3 years, 7 months ago (2017-05-02 15:49:45 UTC) #40
Nico
https://codereview.chromium.org/2845113005/diff/220001/base/memory/shared_memory_win.cc File base/memory/shared_memory_win.cc (right): https://codereview.chromium.org/2845113005/diff/220001/base/memory/shared_memory_win.cc#newcode343 base/memory/shared_memory_win.cc:343: ProcessHandle process = GetCurrentProcess(); On 2017/05/02 15:48:39, Nico wrote: ...
3 years, 7 months ago (2017-05-02 15:51:34 UTC) #41
erikchen
https://codereview.chromium.org/2845113005/diff/220001/base/memory/shared_memory.h File base/memory/shared_memory.h (right): https://codereview.chromium.org/2845113005/diff/220001/base/memory/shared_memory.h#newcode210 base/memory/shared_memory.h:210: // ownership of the handle. CHECK-fails if the region ...
3 years, 7 months ago (2017-05-02 17:52:19 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2845113005/240001
3 years, 7 months ago (2017-05-02 17:53:02 UTC) #46
commit-bot: I haz the power
3 years, 7 months ago (2017-05-02 19:05:18 UTC) #49
Message was sent while issue was closed.
Committed patchset #13 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/c87903ecca1345c4363da94e0120...

Powered by Google App Engine
This is Rietveld 408576698