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

Issue 1166473003: Add a method BrokerDuplicateSharedMemoryHandle() to the sandbox. (Closed)

Created:
5 years, 6 months ago by erikchen
Modified:
5 years, 6 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, rickyz+watch_chromium.org, jln+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@shared_memory_add_helper_methods
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a method BrokerDuplicateSharedMemoryHandle() to the sandbox. This CL is a refactor and has no intended behavior change. On Windows, a sandboxed process calls content::BrokerDuplicateHandle to duplicate a SharedMemoryHandle. On POSIX, a sandboxed process typically calls dup(). I am updating the mechanism for SharedMemory on Mac to use Mach primitives, which will require yet another method for passing SharedMemoryHandles between unprivileged processes. This CL adds a new method content::BrokerDuplicateSharedMemoryHandle, whose implementation will call content::BrokerDuplicateHandle on Windows, dup() on Linux, and some appropriate IPC on Mac. For now, the Mac implementation also uses dup(). This solution has two benefits: - It can be easily extended to support a Mach based Mechanism for duplicating SharedMemoryHandles. - It extracts duplicated, cross-platform code from several locations. BUG=466437 Committed: https://crrev.com/89ca3adb35bd9a610045344e97402b355dcb9564 Cr-Commit-Position: refs/heads/master@{#332553}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Rename method. #

Total comments: 2

Patch Set 4 : Rebase against top of tree. #

Patch Set 5 : Comments from rsesek. #

Patch Set 6 : Rebase. #

Patch Set 7 : Don't declare or define BrokerDuplicateSharedMemoryHandle() on Linux. #

Patch Set 8 : Pass SharedMemoryHandle by const ref. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -0 lines) Patch
M content/common/sandbox_init_mac.cc View 1 2 3 4 5 6 7 1 chunk +8 lines, -0 lines 0 comments Download
M content/common/sandbox_init_win.cc View 1 2 3 4 5 6 7 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/common/sandbox_init.h View 1 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (15 generated)
erikchen
rsesek: Please review. Note that this CL depends on https://codereview.chromium.org/1164473003/
5 years, 6 months ago (2015-05-29 21:33:25 UTC) #2
Robert Sesek
LGTM w/ a nit https://codereview.chromium.org/1166473003/diff/40001/content/public/common/sandbox_init.h File content/public/common/sandbox_init.h (right): https://codereview.chromium.org/1166473003/diff/40001/content/public/common/sandbox_init.h#newcode40 content/public/common/sandbox_init.h:40: #endif // defined(OS_WIN) || defined(OS_POSIX) ...
5 years, 6 months ago (2015-06-01 22:00:41 UTC) #3
erikchen
https://codereview.chromium.org/1166473003/diff/40001/content/public/common/sandbox_init.h File content/public/common/sandbox_init.h (right): https://codereview.chromium.org/1166473003/diff/40001/content/public/common/sandbox_init.h#newcode40 content/public/common/sandbox_init.h:40: #endif // defined(OS_WIN) || defined(OS_POSIX) On 2015/06/01 22:00:41, Robert ...
5 years, 6 months ago (2015-06-01 22:08:35 UTC) #4
erikchen
avi: Looking for an OWNER review.
5 years, 6 months ago (2015-06-01 22:10:11 UTC) #8
Avi (use Gerrit)
lgtm
5 years, 6 months ago (2015-06-02 14:58:31 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1166473003/80001
5 years, 6 months ago (2015-06-02 16:35:11 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/58547)
5 years, 6 months ago (2015-06-02 16:59:01 UTC) #14
erikchen
rsesek: No response expected. I removed the declaration and definition of BrokerDuplicateSharedMemoryHandle() from Linux. My ...
5 years, 6 months ago (2015-06-03 00:11:16 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1166473003/140001
5 years, 6 months ago (2015-06-03 01:25:01 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1166473003/160001
5 years, 6 months ago (2015-06-03 01:54:12 UTC) #25
commit-bot: I haz the power
Committed patchset #8 (id:160001)
5 years, 6 months ago (2015-06-03 04:30:39 UTC) #26
commit-bot: I haz the power
5 years, 6 months ago (2015-06-03 04:32:15 UTC) #27
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/89ca3adb35bd9a610045344e97402b355dcb9564
Cr-Commit-Position: refs/heads/master@{#332553}

Powered by Google App Engine
This is Rietveld 408576698