Closed
Bug 773683
Opened 13 years ago
Closed 13 years ago
Improve PCOMContentPermissionRequest usage safety
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla17
People
(Reporter: dougt, Assigned: wchen)
Details
Attachments
(1 file, 2 obsolete files)
From bug 761930 - jdm -
Given that there are now so many implementations of PCOMContentPermissionRequest, I would like to propose some runtime asserts to help catch any misuses of the class. Specifically, add a member variable mIPCOpen that is initialized to true, and is set to false in a method that is called by TabChild::DeallocPContentPermissionRequest. Add a destructor to PCOMContentPermissionRequest that asserts that mIPCOpen is false, which should catch any cases when the request object dies before IPDL would expect it to.
Comment 1•13 years ago
|
||
We could even override PTabChild::SendPContentPermissionRequest to call a method that sets mIPCOpen to true, to ensure we don't have any problems with request objects that are created but not sent. Belt and suspenders, etc.
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → wchen
Assignee | ||
Comment 2•13 years ago
|
||
Attachment #643045 -
Flags: review?(doug.turner)
Reporter | ||
Updated•13 years ago
|
Attachment #643045 -
Flags: review?(doug.turner) → review?(josh)
Comment 3•13 years ago
|
||
Comment on attachment 643045 [details] [diff] [review]
Added runtime assertion to ensure PCOMContentPermissionRequestChild is live while protocol is live.
Review of attachment 643045 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/ipc/PCOMContentPermissionRequestChild.h
@@ +25,5 @@
> + PCOMContentPermissionRequestChild() : mIPCOpen(false) {}
> + virtual ~PCOMContentPermissionRequestChild() {
> + // mIPCOpen is set to true in TabChild::SendPContentPermissionRequestConstructor
> + // and set to false in TabChild::DeallocPContentPermissionRequest
> + NS_ASSERTION(!mIPCOpen, "Protocol must not be open when PCOMContentPermissionRequestChild is destroyed.");
Let's make this MOZ_ASSERT.
Attachment #643045 -
Flags: review?(josh) → review+
Assignee | ||
Comment 4•13 years ago
|
||
Changed NS_ASSERTION to MOZ_ASSERT
Attachment #643045 -
Attachment is obsolete: true
Attachment #643492 -
Flags: review?(josh)
Assignee | ||
Comment 5•13 years ago
|
||
Updated patch description with r=jdm
Attachment #643492 -
Attachment is obsolete: true
Attachment #643492 -
Flags: review?(josh)
Attachment #643494 -
Flags: review?(josh)
Updated•13 years ago
|
Attachment #643494 -
Flags: review?(josh) → review+
Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 6•13 years ago
|
||
Flags: in-testsuite-
Keywords: checkin-needed
Comment 7•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•