Closed Bug 1440199 Opened 7 years ago Closed 7 years ago

Remove unused functionality from Chromium IPC shared memory, including named shared memory

Categories

(Core :: IPC, enhancement, P1)

60 Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox60 --- wontfix
firefox61 --- fixed

People

(Reporter: jld, Assigned: jld)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

There are a few things in base::SharedMemory that aren't currently being used — locks, named segments, and POSIX-only IDs (really inode numbers). We could remove a few hundred lines of code, and I have patches which do this and pass Try. This would also make it easier to make improvements to what remains of shared memory, like the sandbox integration proposed in bug 1439057, or maybe using shm_open() on POSIX platforms instead of direct filesystem access. (It might also help with possibly simplifying the class hierarchy — there are (at least?) four different classes representing various aspects of “a shared memory segment”, and I don't think the code really needs to be that difficult to follow.)
Priority: -- → P3
Priority: P3 → P1
I wasn't sure who else among the IPC peers would be a good reviewer for shmem; redirect if needed.
Comment on attachment 8960849 [details] Bug 1440199 - Part 1: Remove Chromium shared memory locks. https://reviewboard.mozilla.org/r/229606/#review235518 I would think we do want some version of this at some point, right? With potentially placing things in shared memory for multiple content processes, we theoretically need some sort of cross-thread/process lock? But maybe this facility is not yet good enough and we should design something better. Regardless, unused code is deleted code. r+!
Attachment #8960849 - Flags: review?(nfroyd) → review+
Comment on attachment 8960850 [details] Bug 1440199 - Part 2: Remove named mode from IPC shared memory. https://reviewboard.mozilla.org/r/229608/#review235524 r=me assuming my understanding below is correct. ::: ipc/chromium/src/base/shared_memory.h (Diff revision 1) > - // If read_only is true, opens the memory as read-only. > - // If open_existing is true, and the shared memory already exists, > - // opens the existing shared memory and ignores the size parameter. > - // If name is the empty string, use a unique name. Why are we also removing `read_only` and `open_existing` too? I can totally understand removing `name`, but the booleans seem like they would be helpful things to have? Oh, I suppose they don't make sense for anonymous shared memory segments, so much; read-onlyness is pointless, and opening an existing one doesn't make much sense because you don't have names. Correct?
Comment on attachment 8960850 [details] Bug 1440199 - Part 2: Remove named mode from IPC shared memory. https://reviewboard.mozilla.org/r/229608/#review235526 Sigh, let's set the r+ flag.
Attachment #8960850 - Flags: review?(nfroyd) → review+
Attachment #8960851 - Flags: review?(nfroyd) → review+
(In reply to Nathan Froyd [:froydnj] from comment #6) > Why are we also removing `read_only` and `open_existing` too? I can totally > understand removing `name`, but the booleans seem like they would be helpful > things to have? Oh, I suppose they don't make sense for anonymous shared > memory segments, so much; read-onlyness is pointless, and opening an > existing one doesn't make much sense because you don't have names. Correct? Exactly. But I'll add that to the commit message.
Pushed by jedavis@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/17c89b6a5972 Part 1: Remove Chromium shared memory locks. r=froydnj https://hg.mozilla.org/integration/autoland/rev/9561bdb8c479 Part 2: Remove named mode from IPC shared memory. r=froydnj https://hg.mozilla.org/integration/autoland/rev/5b55e19c6ce1 Part 3: Remove IPC shared memory IDs. r=froydnj
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: