WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
166749
Add support for MediaKeySystemAccess.createMediaKeys()
https://bugs.webkit.org/show_bug.cgi?id=166749
Summary
Add support for MediaKeySystemAccess.createMediaKeys()
Jer Noble
Reported
2017-01-05 18:00:56 PST
Add support for MediaKeySystemAccess.createMediaKeys()
Attachments
Patch
(31.59 KB, patch)
2017-01-05 18:10 PST
,
Jer Noble
eric.carlson
: review+
Details
Formatted Diff
Diff
Patch for landing
(31.50 KB, patch)
2017-01-05 20:59 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Jer Noble
Comment 1
2017-01-05 18:10:20 PST
Created
attachment 298158
[details]
Patch
Eric Carlson
Comment 2
2017-01-05 18:42:21 PST
Comment on
attachment 298158
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=298158&action=review
> Source/WebCore/Modules/encryptedmedia/CDMInstance.h:35 > +struct MediaKeysRestrictions;
Nit: "MediaKeysRestrictions" is unnecessary.
> Source/WebCore/Modules/encryptedmedia/CDMPrivate.h:40 > +
Nit: extra blank line.
Jer Noble
Comment 3
2017-01-05 20:59:28 PST
Created
attachment 298170
[details]
Patch for landing
WebKit Commit Bot
Comment 4
2017-01-06 10:49:29 PST
Comment on
attachment 298170
[details]
Patch for landing Clearing flags on attachment: 298170 Committed
r210445
: <
http://trac.webkit.org/changeset/210445
>
Darin Adler
Comment 5
2017-01-06 13:50:15 PST
Comment on
attachment 298170
[details]
Patch for landing View in context:
https://bugs.webkit.org/attachment.cgi?id=298170&action=review
Some post-landing comments.
> Source/WebCore/Modules/encryptedmedia/CDMInstance.h:43 > + enum SuccessValue { > + Failed, > + Succeeded, > + };
One liner maybe? I don’t see a reason to spread this over four lines. I am not sure this idiom is great. Is there some less wordy way we could do this? I might just prefer a success boolean rather than a special type, even though it would require a comment defining the meaning of the boolean.
> Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.cpp:77 > + std::unique_ptr<CDMInstance> instance = m_implementation->createInstance();
auto would be good here
> Source/WebCore/testing/MockCDMFactory.cpp:127 > + return std::unique_ptr<CDMInstance>(new MockCDMInstance(m_weakPtrFactory.createWeakPtr()));
Can we find a way to use make_unique instead of new here? I know there are possibly privacy reason to not do that.
> Source/WebCore/testing/MockCDMFactory.cpp:167 > + MockCDMFactory* factory = m_cdm ? m_cdm->factory() : nullptr;
auto*
> Source/WebCore/testing/MockCDMFactory.h:78 > MockCDM(WeakPtr<MockCDMFactory>);
Should take a const WeakPtr<MockCDMFactory>& for better efficiency. Should probably be marked explicit, too.
> Source/WebCore/testing/MockCDMFactory.h:102 > + MockCDMInstance(WeakPtr<MockCDM>);
Should take a const WeakPtr<MockCDM>& for better efficiency. Should probably be marked explicit, too.
Jer Noble
Comment 6
2017-01-06 14:38:07 PST
(In reply to
comment #5
)
> Comment on
attachment 298170
[details]
> Patch for landing > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=298170&action=review
> > Some post-landing comments. > > > Source/WebCore/Modules/encryptedmedia/CDMInstance.h:43 > > + enum SuccessValue { > > + Failed, > > + Succeeded, > > + }; > > One liner maybe? I don’t see a reason to spread this over four lines. > > I am not sure this idiom is great. Is there some less wordy way we could do > this? I might just prefer a success boolean rather than a special type, even > though it would require a comment defining the meaning of the boolean.
Eh, the usefulness of this idiom is that it makes sense in the calling context. The boolean return value idiom would need a comment everywhere it's called to be as clear. I think this is better than a boolean return, but maybe not as good as it good be.
> > Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.cpp:77 > > + std::unique_ptr<CDMInstance> instance = m_implementation->createInstance(); > > auto would be good here
Ok.
> > Source/WebCore/testing/MockCDMFactory.cpp:127 > > + return std::unique_ptr<CDMInstance>(new MockCDMInstance(m_weakPtrFactory.createWeakPtr())); > > Can we find a way to use make_unique instead of new here? I know there are > possibly privacy reason to not do that.
This issue is that the compiler can't find a good way to cast a unique_ptr<MockCDMInstance> to a unique_ptr<CDMInstance>.
> > Source/WebCore/testing/MockCDMFactory.cpp:167 > > + MockCDMFactory* factory = m_cdm ? m_cdm->factory() : nullptr; > > auto*
Ok.
> > Source/WebCore/testing/MockCDMFactory.h:78 > > MockCDM(WeakPtr<MockCDMFactory>); > > Should take a const WeakPtr<MockCDMFactory>& for better efficiency. Should > probably be marked explicit, too.
Not a WeakPtr<MockCDMFactory>&&?
> > Source/WebCore/testing/MockCDMFactory.h:102 > > + MockCDMInstance(WeakPtr<MockCDM>); > > Should take a const WeakPtr<MockCDM>& for better efficiency. Should probably > be marked explicit, too.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug