WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
176791
[EME] Implement CDMInstanceClearKey::updateLicense()
https://bugs.webkit.org/show_bug.cgi?id=176791
Summary
[EME] Implement CDMInstanceClearKey::updateLicense()
Zan Dobersek
Reported
2017-09-12 10:44:08 PDT
[EME] Implement CDMInstanceClearKey::updateLicense()
Attachments
Patch
(30.90 KB, patch)
2017-09-12 11:04 PDT
,
Zan Dobersek
no flags
Details
Formatted Diff
Diff
Patch for landing
(31.17 KB, patch)
2017-09-13 00:13 PDT
,
Zan Dobersek
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Zan Dobersek
Comment 1
2017-09-12 11:04:29 PDT
Created
attachment 320556
[details]
Patch
Build Bot
Comment 2
2017-09-12 11:06:10 PDT
Attachment 320556
[details]
did not pass style-queue: ERROR: Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:357: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 22 files If any of these errors are false positives, please file a bug against check-webkit-style.
Xabier Rodríguez Calvar
Comment 3
2017-09-12 23:46:15 PDT
Comment on
attachment 320556
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=320556&action=review
Really nice!
> Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:47 > + using KeyStore = HashMap<String, Vector<CDMInstanceClearKey::Key>>;
I would leave blank lines before and after this line.
> Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:345 > + auto dispatchCallback = > + [this, &callback](bool sessionWasClosed, std::optional<KeyStatusVector>&& changedKeys, SuccessValue succeeded) { > + callOnMainThread( > + [weakThis = m_weakPtrFactory.createWeakPtr(), callback = WTFMove(callback), sessionWasClosed, changedKeys = WTFMove(changedKeys), succeeded] () mutable { > + if (!weakThis) > + return; > + > + callback(sessionWasClosed, WTFMove(changedKeys), std::nullopt, std::nullopt, succeeded); > + }); > + };
Two lambdas in the same variable declaration cause you can! :))) I'd add a comment explaining that the inner lambda is the one executed in the main thread and the outter one is a way to avoid having that line duplicated several times in the following code.
> Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:373 > + if (existingKey->size() != proposedKey->size() || std::memcmp(existingKey->data(), proposedKey->data(), existingKey->size())) {
I'd add a comment here cause we actually try to move the memory if sizes are equal but we do it in the if clause, and then if that fails, we move the key. I think this way is the most elegant way of doing it, but I think it still requires some clarification.
Zan Dobersek
Comment 4
2017-09-13 00:06:35 PDT
Comment on
attachment 320556
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=320556&action=review
>> Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:47 >> + using KeyStore = HashMap<String, Vector<CDMInstanceClearKey::Key>>; > > I would leave blank lines before and after this line.
I'd say only after, leaving an empty line before would look odd.
>> Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:345 >> + }; > > Two lambdas in the same variable declaration cause you can! :))) I'd add a comment explaining that the inner lambda is the one executed in the main thread and the outter one is a way to avoid having that line duplicated several times in the following code.
I'll add the comment.
>> Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:373 >> + if (existingKey->size() != proposedKey->size() || std::memcmp(existingKey->data(), proposedKey->data(), existingKey->size())) { > > I'd add a comment here cause we actually try to move the memory if sizes are equal but we do it in the if clause, and then if that fails, we move the key. I think this way is the most elegant way of doing it, but I think it still requires some clarification.
Only the Key object is moved, in case there's difference between the existing and proposed keys' values, in either size or data.
Zan Dobersek
Comment 5
2017-09-13 00:13:29 PDT
Created
attachment 320623
[details]
Patch for landing
Build Bot
Comment 6
2017-09-13 00:14:49 PDT
Attachment 320623
[details]
did not pass style-queue: ERROR: Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:360: More than one command on the same line [whitespace/newline] [4] Total errors found: 1 in 22 files If any of these errors are false positives, please file a bug against check-webkit-style.
Zan Dobersek
Comment 7
2017-09-13 00:37:15 PDT
Comment on
attachment 320623
[details]
Patch for landing Clearing flags on attachment: 320623 Committed
r221961
: <
http://trac.webkit.org/changeset/221961
>
Zan Dobersek
Comment 8
2017-09-13 00:37:19 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9
2017-09-27 12:30:46 PDT
<
rdar://problem/34693406
>
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