Closed Bug 1038966 Opened 10 years ago Closed 10 years ago

Shmem should use refcounted pointer classes when creating SharedMemory

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

This is the largest piece of work to prepare for bug 1028148.

Shmem manipulates SharedMemory in a number of places, including in IPDL generated code.  Rather than using nsRefPtr and friends, it uses a harrowing combination of nsAutoPtr and manual AddRefing and Releasing.

These SharedMemory are actually owned by the mShmemMap field of the PFoo{Parent,Child} data structures, as far as I can tell.  That is a Chromium IDMap, which I didn't want to mess with to make the ownership explicit there, so instead there is some usage of take() to explicitly move the ownership over.
Blocks: 1038977
Summary: Shmem should use nsRefPtrs to handle SharedMemory → Shmem should use refcounted pointer classes when creating SharedMemory
I'm going on PTO tomorrow, so I'm not going to bother requesting review, but here are the patches in case anybody is curious.
Rename these before changing the definition to reduce the noise in the next patch.
Attachment #8457431 - Flags: review?(bent.mozilla)
Attachment #8457432 - Flags: review?(bent.mozilla)
Attachment #8457433 - Flags: review?(bent.mozilla)
Attachment #8457431 - Flags: review?(bent.mozilla) → review+
Attachment #8457432 - Flags: review?(bent.mozilla) → review+
Comment on attachment 8457433 [details] [diff] [review]
part 3 - Shmem should use refcounted pointer classes when creating SharedMemory.

Review of attachment 8457433 [details] [diff] [review]:
-----------------------------------------------------------------

This all looked great. Thanks!
Attachment #8457433 - Flags: review?(bent.mozilla) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: