Closed Bug 1048107 Opened 10 years ago Closed 10 years ago

[EME] Implement GMPTimer and clock

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)

Implement GMPTimer interfaces, and the GMPGetCurrentTime function that lives in GMPPlatformAPI.
Attached patch Patch v1Splinter Review
Implements GMPTimer. Service is requested and instantiated on the child process side first, unlike our other interfaces.

Also adds a placeholder implementation of GMPGetCurrentTime.
Attachment #8466877 - Flags: review?(rjesup)
Comment on attachment 8466877 [details] [diff] [review]
Patch v1

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

::: content/media/gmp/GMPChild.h
@@ +62,5 @@
>  
>    virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
>    virtual void ProcessingError(Result aWhat) MOZ_OVERRIDE;
>  
> +  nsRefPtr<GMPTimerChild> mTimerChild;  

spaces

::: content/media/gmp/GMPTimerChild.cpp
@@ +41,5 @@
> +    return GMPQuotaExceededErr;
> +  }
> +  uint32_t timerId = mTimerCount;
> +  mTimers.Put(timerId, aTask);
> +  mTimerCount++;

thread assertion, since we're not locking? However, maybe irrelevant since we call SendSetTimer(), and I think the IPC code asserts on threads.
Attachment #8466877 - Flags: review?(rjesup) → review+
(In reply to Randell Jesup [:jesup] from comment #2)
> ::: content/media/gmp/GMPTimerChild.cpp
> @@ +41,5 @@
> > +    return GMPQuotaExceededErr;
> > +  }
> > +  uint32_t timerId = mTimerCount;
> > +  mTimers.Put(timerId, aTask);
> > +  mTimerCount++;
> 
> thread assertion, since we're not locking? However, maybe irrelevant since
> we call SendSetTimer(), and I think the IPC code asserts on threads.


We return failure on line 35 if this is called on a non-main thread. We could assert as well, so that the issue is more visible to plugin authors?
Flags: needinfo?(cpearce)
Comment on attachment 8466877 [details] [diff] [review]
Patch v1

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

::: content/media/gmp/GMPParent.cpp
@@ +627,5 @@
> +
> +PGMPTimerParent*
> +GMPParent::AllocPGMPTimerParent()
> +{
> +  GMPTimerParent* p = new GMPTimerParent(GMPThread());

Bustage fix: GMPThread() is only defined in debug builds. It needs to be present in opt builds too, and I think we're better off naming it GetGMPThread(), so that it doesn't conflict with the name of the threads that we expose to the GMPs; GMPThread.

::: content/media/gmp/GMPTimerParent.cpp
@@ +64,5 @@
> +void
> +GMPTimerParent::GMPTimerExpired(nsITimer *aTimer, void *aClosure)
> +{
> +  MOZ_ASSERT(aClosure);
> +  nsAutoPtr<Context> ctx = static_cast<Context*>(aClosure);

Bustage fix:

nsAutoPtr<Context> ctx(static_cast<Context*>(aClosure));
Somehow I managed to not include my bustage fix in my push when I pushed to inbound...
Fix: https://hg.mozilla.org/integration/mozilla-inbound/rev/7cb757252c04
https://hg.mozilla.org/mozilla-central/rev/238e2c78035c
https://hg.mozilla.org/mozilla-central/rev/7cb757252c04
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Depends on: 1050582
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: