Closed
Bug 1397123
Opened 8 years ago
Closed 8 years ago
[EME] Decouple ChromiumCDMProxy from ChromiumCDMParent.
Categories
(Core :: Audio/Video: GMP, enhancement, P1)
Core
Audio/Video: GMP
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: JamesCheng, Assigned: JamesCheng)
References
Details
Attachments
(2 files)
When I'm trying to fix Bug 1396493, in TestGMPCrossOrigin, I get the CDM by
'service->GetCDM(' and it will resolve the promise with ChromiumCDMParent instance, then I need to call its Init function, but it needs a ChromiumCDMProxy[1] which I couldn't create it in gtest.
I think I should follow the idea from [2] to loose the dependency between classes.
[1]
http://searchfox.org/mozilla-central/rev/f2a1911ad310bf8651f342d719e4f4ca0a7b9bfb/dom/media/gmp/ChromiumCDMParent.cpp#43
[2]
https://dxr.mozilla.org/mozilla-beta/rev/72a20e86b67a02fe180bf32f5526998e9fd52d55/dom/media/gmp/GMPCDMCallbackProxy.h#18
Assignee | ||
Updated•8 years ago
|
Summary: Decouple ChromiumCDMProxy from ChromiumCDMParent. → [EME] Decouple ChromiumCDMProxy from ChromiumCDMParent.
Assignee | ||
Updated•8 years ago
|
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Updated•8 years ago
|
Rank: 15
Priority: -- → P1
Comment hidden (mozreview-request) |
Comment 4•8 years ago
|
||
mozreview-review |
Comment on attachment 8905390 [details]
Bug 1397123 - [Part1] Make aMessage of CDMProxy::OnSessionMessage const.
https://reviewboard.mozilla.org/r/177170/#review183056
::: commit-message-d8e23:3
(Diff revision 3)
> +Bug 1397123 - [EME] Decouple ChromiumCDMProxy from ChromiumCDMParent. r?cpearce
> +
> +1. Make aMessage in CDMProxy::OnSessionMessage be const reference.
Making the aMessage argument of OnSessionMessage() const should be a separate changeset. It is logically a separate and unrelated change.
One changeset per idea.
::: dom/media/gmp/ChromiumCDMCallbackProxy.cpp:126
(Diff revision 3)
> + nsTArray<mozilla::gmp::CDMKeyInformation> && aKeysInfo)
> +{
> + bool keyStatusesChange = false;
> + {
> + CDMCaps::AutoLock caps(mProxy->Capabilites());
> + for (size_t i = 0; i < aKeysInfo.Length(); i++) {
This would be nicer as a range-based for loop.
::: dom/media/gmp/ChromiumCDMParent.h:22
(Diff revision 3)
> #include "PlatformDecoderModule.h"
> #include "ImageContainer.h"
> #include "mozilla/Span.h"
> #include "ReorderQueue.h"
>
> +
You added an extra line break here. Please run `./mach clang-format` on your patches before requesting review.
::: dom/media/gmp/ChromiumCDMParent.cpp:1084
(Diff revision 3)
> - mProxy,
> - &ChromiumCDMProxy::Shutdown),
> - NS_DISPATCH_NORMAL);
> }
>
> - // We may be called from a task holding the last reference to the proxy, so
> + // We may be called from a task holding the last reference to the cdmcallback, so
s/cdmcallback/CDM callback/
Attachment #8905390 -
Flags: review?(cpearce) → review-
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 7•8 years ago
|
||
Fixed the review feedback,
Thank you and I will do mach clang-format from now on.
Comment 8•8 years ago
|
||
mozreview-review |
Comment on attachment 8906467 [details]
Bug 1397123 - [Part2] Decouple ChromiumCDMProxy from ChromiumCDMParent.
https://reviewboard.mozilla.org/r/178218/#review183542
::: dom/media/gmp/ChromiumCDMParent.h:9
(Diff revision 1)
> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
>
> #ifndef ChromiumCDMParent_h_
> #define ChromiumCDMParent_h_
>
> +#include "ChromiumCDMCallback.h"
Where possible, you should predeclare classes where the compiler doesn't yet need to know the size of the object. That way you don't need to #include the file. This will speed up compilation.
I think that applies here. So instead of including ChromiumCDMCallback, pre-declare with:
class ChromiumCDMCallback;
Attachment #8906467 -
Flags: review?(cpearce) → review+
Comment 9•8 years ago
|
||
mozreview-review |
Comment on attachment 8905390 [details]
Bug 1397123 - [Part1] Make aMessage of CDMProxy::OnSessionMessage const.
https://reviewboard.mozilla.org/r/177170/#review183544
Attachment #8905390 -
Flags: review?(cpearce) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Comment 11•8 years ago
|
||
(In reply to Chris Pearce (:cpearce) from comment #8)
> Comment on attachment 8906467 [details]
> Bug 1397123 - [Part2] Decouple ChromiumCDMProxy from ChromiumCDMParent.
>
> https://reviewboard.mozilla.org/r/178218/#review183542
>
> ::: dom/media/gmp/ChromiumCDMParent.h:9
> (Diff revision 1)
> > * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
> >
> > #ifndef ChromiumCDMParent_h_
> > #define ChromiumCDMParent_h_
> >
> > +#include "ChromiumCDMCallback.h"
>
> Where possible, you should predeclare classes where the compiler doesn't yet
> need to know the size of the object. That way you don't need to #include the
> file. This will speed up compilation.
>
> I think that applies here. So instead of including ChromiumCDMCallback,
> pre-declare with:
>
> class ChromiumCDMCallback;
Yes, I miss this one.
Thank you.
Comment 12•8 years ago
|
||
Pushed by jacheng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2d41a6eb4df4
[Part1] Make aMessage of CDMProxy::OnSessionMessage const. r=cpearce
https://hg.mozilla.org/integration/autoland/rev/803c2d6f4be4
[Part2] Decouple ChromiumCDMProxy from ChromiumCDMParent. r=cpearce
Comment 13•8 years ago
|
||
Backed out in https://hg.mozilla.org/integration/autoland/rev/99f47bca403a for Android build bustage, https://treeherder.mozilla.org/logviewer.html#?job_id=130246546&repo=autoland
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 16•8 years ago
|
||
Updated the patch for Fennec-only code.
Try looks good,
https://treeherder.mozilla.org/#/jobs?repo=try&revision=512f688e4c55ac41824b9ca227cbef1b91835d9d
Re-push it again.
Comment 17•8 years ago
|
||
Pushed by jacheng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7d56316ea722
[Part1] Make aMessage of CDMProxy::OnSessionMessage const. r=cpearce
https://hg.mozilla.org/integration/autoland/rev/a359e9bd31c7
[Part2] Decouple ChromiumCDMProxy from ChromiumCDMParent. r=cpearce
![]() |
||
Comment 18•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7d56316ea722
https://hg.mozilla.org/mozilla-central/rev/a359e9bd31c7
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•