Closed Bug 889778 Opened 8 years ago Closed 7 years ago

nsDOMCamaraManager: Move NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY to the begin of QI

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34
Tracking Status
b2g-v1.4 --- affected
b2g-v2.0 --- affected
b2g-v2.1 --- affected

People

(Reporter: allstars.chh, Assigned: mikeh)

References

Details

Attachments

(1 file, 1 obsolete file)

See https://bugzilla.mozilla.org/show_bug.cgi?id=883741#c9
and 
https://bugzilla.mozilla.org/show_bug.cgi?id=883741#c12

I did a test by changing 
nsRefPtr<nsDOMCameraManager> mCameraManager;
to 
nsCOMPtr<nsDOMCameraManager> mCameraManager;
in Navigator.h 

And I did see  ###!!! ASSERTION: QueryInterface needed: 'query_result.get() == mRawPtr', file ../../dist/include/nsCOMPtr.h, line 547

So we should move NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY to the begin of QI.
Assignee: nobody → allstars.chh
It seems the assertion is already there without my test patch.
Yoink.
Assignee: allstars.chh → mhabicher
[Blocking Requested - why for this release]: without this patch, the CameraManager is not able to function as a weak nsIObserver: calls to AddObserver(..., true /* weak */) will always fail.
Status: NEW → ASSIGNED
blocking-b2g: --- → 2.1?
OS: Linux → Gonk (Firefox OS)
Hardware: x86_64 → ARM
Bonus version that moves NS_WRAPPERCACHE... and does proper error-checking.

try-server push: https://tbpl.mozilla.org/?tree=Try&rev=33bf9d76141c
Attachment #8477432 - Attachment is obsolete: true
Attachment #8477432 - Flags: review?(jst)
Attachment #8477494 - Flags: review?(jst)
Attachment #8477494 - Flags: review?(jst) → review+
https://hg.mozilla.org/mozilla-central/rev/408786bfc72a
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
blocking-b2g: 2.1? → ---
You need to log in before you can comment on or make changes to this bug.