Bug 151963 - [EME] Correctly report errors when generating key requests from AVContentKeySession.
Summary: [EME] Correctly report errors when generating key requests from AVContentKeyS...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on: 153267
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-07 13:51 PST by Jer Noble
Modified: 2016-09-05 01:24 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.31 KB, patch)
2015-12-07 13:54 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (39.98 KB, patch)
2016-01-19 11:25 PST, Jer Noble
eric.carlson: review+
Details | Formatted Diff | Diff
Patch for landing (42.45 KB, patch)
2016-01-19 21:51 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (42.45 KB, patch)
2016-01-19 22:44 PST, Jer Noble
commit-queue: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2015-12-07 13:51:46 PST
[EME] Correctly report errors when generating key requests from AVContentKeySession.
Comment 1 Jer Noble 2015-12-07 13:54:03 PST
Created attachment 266809 [details]
Patch
Comment 2 Darin Adler 2015-12-08 09:15:15 PST
Comment on attachment 266809 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=266809&action=review

> Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:286
> +        NSError* error = nullptr;

Style should be:

    NSError *error = nil;

> Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:290
> +            systemCode = std::abs(systemCodeForError(error));

The use of std::abs here seems bizarre. Test coverage?
Comment 3 Jer Noble 2015-12-08 10:41:39 PST
(In reply to comment #2)
> Comment on attachment 266809 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=266809&action=review
> 
> > Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:286
> > +        NSError* error = nullptr;
> 
> Style should be:
> 
>     NSError *error = nil;

Ok.

> > Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:290
> > +            systemCode = std::abs(systemCodeForError(error));
> 
> The use of std::abs here seems bizarre. Test coverage?

Established in https://bugs.webkit.org/show_bug.cgi?id=138986 / <rdar://problem/19118302>.
Comment 4 Jer Noble 2016-01-19 11:25:25 PST
Created attachment 269275 [details]
Patch
Comment 5 Jer Noble 2016-01-19 11:26:23 PST
New approach; fix the underlying problem where WebIDL requires a 'unsigned long' to be a 32-bit int, and we are storing the value as a 64-bit int.
Comment 6 Jer Noble 2016-01-19 11:37:22 PST
Committed r195302: <http://trac.webkit.org/changeset/195302>
Comment 7 Ryan Haddad 2016-01-19 19:37:44 PST
This change broke the Windows build:

c:\cygwin\home\buildbot\slave\win-release\build\source\webcore\platform\graphics\avfoundation\cf\CDMSessionAVFoundationCF.h(47): error C3668: 'WebCore::CDMSessionAVFoundationCF::generateKeyRequest': method with override specifier 'override' did not override any base class methods (compiling source file C:\cygwin\home\buildbot\slave\win-release\build\Source\WebCore\platform\graphics\avfoundation\cf\CDMSessionAVFoundationCF.cpp) [C:\cygwin\home\buildbot\slave\win-release\build\WebKitBuild\Release\Source\WebCore\WebCore.vcxproj]
c:\cygwin\home\buildbot\slave\win-release\build\source\webcore\platform\graphics\avfoundation\cf\CDMSessionAVFoundationCF.h(49): error C3668: 'WebCore::CDMSessionAVFoundationCF::update': method with override specifier 'override' did not override any base class methods (compiling source file C:\cygwin\home\buildbot\slave\win-release\build\Source\WebCore\platform\graphics\avfoundation\cf\CDMSessionAVFoundationCF.cpp) [C:\cygwin\home\buildbot\slave\win-release\build\WebKitBuild\Release\Source\WebCore\WebCore.vcxproj]
  JSWebKitPlaybackTargetAvailabilityEvent.cpp

<https://build.webkit.org/builders/Apple%20Win%20Release%20%28Build%29/builds/75221>
Comment 8 Jer Noble 2016-01-19 21:51:23 PST
Created attachment 269339 [details]
Patch for landing

Fix the Windows build.
Comment 9 Jer Noble 2016-01-19 22:44:23 PST
Created attachment 269342 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2016-01-21 09:15:27 PST
Comment on attachment 269342 [details]
Patch for landing

Clearing flags on attachment: 269342

Committed r195410: <http://trac.webkit.org/changeset/195410>
Comment 11 WebKit Commit Bot 2016-01-22 10:45:28 PST
Comment on attachment 269342 [details]
Patch for landing

Rejecting attachment 269342 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'apply-attachment', '--no-update', '--non-interactive', 269342, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
ED at 65.
Hunk #4 FAILED at 96.
4 out of 4 hunks FAILED -- saving rejects to file Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm.rej
patching file Source/WebCore/testing/MockCDM.cpp
Hunk #1 FAILED at 44.
Hunk #2 FAILED at 112.
Hunk #3 FAILED at 128.
3 out of 3 hunks FAILED -- saving rejects to file Source/WebCore/testing/MockCDM.cpp.rej

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/726179
Comment 12 Joseph Pecoraro 2016-09-05 01:24:06 PDT
Comment on attachment 269342 [details]
Patch for landing

View in context: https://bugs.webkit.org/attachment.cgi?id=269342&action=review

> Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:307
> -PassRefPtr<Uint8Array> CDMSessionAVStreamSession::generateKeyReleaseMessage(unsigned short& errorCode, unsigned long& systemCode)
> +PassRefPtr<Uint8Array> CDMSessionAVStreamSession::generateKeyReleaseMessage(unsigned short& errorCode, uint32_t systemCode)

The change from reference to non-reference seems unintentional. No caller actually uses the value, but it does get assigned inside this method.

The static analyzer complains about the unused values assigned to systemCode.