[EME] Correctly report errors when generating key requests from AVContentKeySession.
Created attachment 266809 [details] Patch
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?
(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>.
Created attachment 269275 [details] Patch
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.
Committed r195302: <http://trac.webkit.org/changeset/195302>
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>
Created attachment 269339 [details] Patch for landing Fix the Windows build.
Created attachment 269342 [details] Patch for landing
Comment on attachment 269342 [details] Patch for landing Clearing flags on attachment: 269342 Committed r195410: <http://trac.webkit.org/changeset/195410>
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 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.