Closed Bug 1050582 Opened 7 years ago Closed 7 years ago

Is on main thread assertion in GMPTimer can fail first call into GMPTimer is off main thread.

Categories

(Core :: Audio/Video, defect)

29 Branch
x86_64
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: cpearce, Assigned: cpearce)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

SetTimerOnMainThread() calls GMPChild::GetGMPTimers(), which calls the GMPTimerChild constructor on its first call. SetTimer is supposed to be only called on the main thread. But the check to ensure we're on the main thread is inside the GMPTimerChild::SetTimer() function. So if the first time SetTimer is called is off main thread, the GMPTimerChild ctor will run off main thread, and will fail.

SetTimerOnMainThread() should check that it's called on the main thread only.
Attached patch PatchSplinter Review
Attachment #8469687 - Flags: review?(rjesup)
Comment on attachment 8469687 [details] [diff] [review]
Patch

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

::: content/media/gmp/GMPPlatform.cpp
@@ +168,5 @@
>  
>  GMPErr
>  SetTimerOnMainThread(GMPTask* aTask, int64_t aTimeoutMS)
>  {
> +  if (!aTask || !sMainLoop || sMainLoop != MessageLoop::current()) {

comment that this is a "isChildMainThread()" test, or create such a function if you see it being reused
Attachment #8469687 - Flags: review?(rjesup) → review+
https://hg.mozilla.org/mozilla-central/rev/8c4a1b3a2a8b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.