Skip to content
Permalink
Browse files
Use MediaKeySystemRequestIdentifier, rather than mysterious uint64_t …
…values, in WebKit

https://bugs.webkit.org/show_bug.cgi?id=229310

Reviewed by Youenn Fablet.

WebCore already had an ObjectIdentifer<> type for media system key requests, MediaKeySystemRequestIdentifier.
Use it in the WebKit layer.

* Scripts/webkit/messages.py:
(types_that_cannot_be_forward_declared):
(headers_for_type):
* UIProcess/MediaKeySystemPermissionRequestManagerProxy.cpp:
(WebKit::MediaKeySystemPermissionRequestManagerProxy::denyRequest):
(WebKit::MediaKeySystemPermissionRequestManagerProxy::grantRequest):
(WebKit::MediaKeySystemPermissionRequestManagerProxy::createRequestForFrame):
* UIProcess/MediaKeySystemPermissionRequestManagerProxy.h:
* UIProcess/MediaKeySystemPermissionRequestProxy.cpp:
(WebKit::MediaKeySystemPermissionRequestProxy::MediaKeySystemPermissionRequestProxy):
* UIProcess/MediaKeySystemPermissionRequestProxy.h:
(WebKit::MediaKeySystemPermissionRequestProxy::create):
(WebKit::MediaKeySystemPermissionRequestProxy::mediaKeySystemID const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestMediaKeySystemPermissionForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/EncryptedMedia/MediaKeySystemPermissionRequestManager.cpp:
(WebKit::MediaKeySystemPermissionRequestManager::sendMediaKeySystemRequest):
(WebKit::MediaKeySystemPermissionRequestManager::mediaKeySystemWasGranted):
(WebKit::MediaKeySystemPermissionRequestManager::mediaKeySystemWasDenied):
* WebProcess/EncryptedMedia/MediaKeySystemPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mediaKeySystemWasGranted):
(WebKit::WebPage::mediaKeySystemWasDenied):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:


Canonical link: https://commits.webkit.org/240791@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
smfr committed Aug 21, 2021
1 parent 7ee2330 commit efbeef4905ab2c06e37c190ecb964f744763a2e0
Showing 18 changed files with 109 additions and 30 deletions.
@@ -27,6 +27,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
Modules/encryptedmedia/MediaKeySystemClient.h
Modules/encryptedmedia/MediaKeySystemController.h
Modules/encryptedmedia/MediaKeySystemRequest.h
Modules/encryptedmedia/MediaKeySystemRequestIdentifier.h

Modules/fetch/FetchBodyConsumer.h
Modules/fetch/FetchBodySource.h
@@ -29,6 +29,7 @@
#include "ActiveDOMObject.h"
#include "IDLTypes.h"
#include "JSDOMPromiseDeferred.h"
#include "MediaKeySystemRequestIdentifier.h"
#include <wtf/CompletionHandler.h>
#include <wtf/Forward.h>
#include <wtf/ObjectIdentifier.h>
@@ -41,9 +42,6 @@ class MediaKeySystem;

template <typename IDLType> class DOMPromiseDeferred;

enum MediaKeySystemRequestIdentifierType { };
using MediaKeySystemRequestIdentifier = ObjectIdentifier<MediaKeySystemRequestIdentifierType>;

class MediaKeySystemRequest : public RefCounted<MediaKeySystemRequest>, public ActiveDOMObject {
public:
WEBCORE_EXPORT static Ref<MediaKeySystemRequest> create(Document&, const String& keySystem, Ref<DeferredPromise>&&);
@@ -0,0 +1,34 @@
/*
* Copyright (C) 2021 Apple Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#pragma once

#include <wtf/ObjectIdentifier.h>

namespace WebCore {

enum MediaKeySystemRequestIdentifierType { };
using MediaKeySystemRequestIdentifier = ObjectIdentifier<MediaKeySystemRequestIdentifierType>;

} // namespace WebCore
@@ -339,6 +339,7 @@
0F6B707A237BC36D0052CA47 /* CSSUnits.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6B7077237BC12F0052CA47 /* CSSUnits.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F73B769222B3A0C00805316 /* ScrollingTreeOverflowScrollingNodeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC0516A219B5EBE0031C39E /* ScrollingTreeOverflowScrollingNodeMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F768C2D26D03841008DBE0B /* UserMediaRequestIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F768C2B26D03841008DBE0B /* UserMediaRequestIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F768C3526D0AB39008DBE0B /* MediaKeySystemRequestIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F768C3326D0AB39008DBE0B /* MediaKeySystemRequestIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F790F432517CE6E009BA034 /* DisplayView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F790F3F2517CE6D009BA034 /* DisplayView.h */; };
0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 072847E216EBC5B00043CFA4 /* PlatformTextTrack.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F850FE31ED7C18300FB77A7 /* PerformanceLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -6232,6 +6233,7 @@
0F736ECA26CCB97A000AD7CA /* LayerTreeAsTextOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayerTreeAsTextOptions.h; sourceTree = "<group>"; };
0F73B765222B327F00805316 /* ScrollingStateScrollingNodeMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingStateScrollingNodeMac.mm; sourceTree = "<group>"; };
0F768C2B26D03841008DBE0B /* UserMediaRequestIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMediaRequestIdentifier.h; sourceTree = "<group>"; };
0F768C3326D0AB39008DBE0B /* MediaKeySystemRequestIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaKeySystemRequestIdentifier.h; sourceTree = "<group>"; };
0F790F3D2517CE6D009BA034 /* DisplayView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayView.cpp; sourceTree = "<group>"; };
0F790F3F2517CE6D009BA034 /* DisplayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayView.h; sourceTree = "<group>"; };
0F7DF1471E2BF1A60095951B /* WebCoreJSClientData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreJSClientData.cpp; sourceTree = "<group>"; };
@@ -28022,6 +28024,7 @@
2D9BF6FB1DBFB71F007A7D99 /* MediaKeySystemMediaCapability.idl */,
9ACC079425C725ED00DC6386 /* MediaKeySystemRequest.cpp */,
9ACC07A525C810DF00DC6386 /* MediaKeySystemRequest.h */,
0F768C3326D0AB39008DBE0B /* MediaKeySystemRequestIdentifier.h */,
2D9BF6FC1DBFB71F007A7D99 /* Navigator+EME.idl */,
2D9BF7401DBFDC0F007A7D99 /* NavigatorEME.cpp */,
2D9BF7411DBFDC0F007A7D99 /* NavigatorEME.h */,
@@ -33585,6 +33588,7 @@
9ACC07A825C8110D00DC6386 /* MediaKeySystemClient.h in Headers */,
9ACC07AF25C8141D00DC6386 /* MediaKeySystemController.h in Headers */,
9ACC07A625C810DF00DC6386 /* MediaKeySystemRequest.h in Headers */,
0F768C3526D0AB39008DBE0B /* MediaKeySystemRequestIdentifier.h in Headers */,
A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */,
0782894825C23FE500A7BA03 /* MediaMetadata.h in Headers */,
0782894C25C3700B00A7BA03 /* MediaMetadataInit.h in Headers */,
@@ -1,3 +1,41 @@
2021-08-21 Simon Fraser <simon.fraser@apple.com>

Use MediaKeySystemRequestIdentifier, rather than mysterious uint64_t values, in WebKit
https://bugs.webkit.org/show_bug.cgi?id=229310

Reviewed by Youenn Fablet.

WebCore already had an ObjectIdentifer<> type for media system key requests, MediaKeySystemRequestIdentifier.
Use it in the WebKit layer.

* Scripts/webkit/messages.py:
(types_that_cannot_be_forward_declared):
(headers_for_type):
* UIProcess/MediaKeySystemPermissionRequestManagerProxy.cpp:
(WebKit::MediaKeySystemPermissionRequestManagerProxy::denyRequest):
(WebKit::MediaKeySystemPermissionRequestManagerProxy::grantRequest):
(WebKit::MediaKeySystemPermissionRequestManagerProxy::createRequestForFrame):
* UIProcess/MediaKeySystemPermissionRequestManagerProxy.h:
* UIProcess/MediaKeySystemPermissionRequestProxy.cpp:
(WebKit::MediaKeySystemPermissionRequestProxy::MediaKeySystemPermissionRequestProxy):
* UIProcess/MediaKeySystemPermissionRequestProxy.h:
(WebKit::MediaKeySystemPermissionRequestProxy::create):
(WebKit::MediaKeySystemPermissionRequestProxy::mediaKeySystemID const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestMediaKeySystemPermissionForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/EncryptedMedia/MediaKeySystemPermissionRequestManager.cpp:
(WebKit::MediaKeySystemPermissionRequestManager::sendMediaKeySystemRequest):
(WebKit::MediaKeySystemPermissionRequestManager::mediaKeySystemWasGranted):
(WebKit::MediaKeySystemPermissionRequestManager::mediaKeySystemWasDenied):
* WebProcess/EncryptedMedia/MediaKeySystemPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mediaKeySystemWasGranted):
(WebKit::WebPage::mediaKeySystemWasDenied):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

2021-08-20 Simon Fraser <simon.fraser@apple.com>

Remove AsyncRequest, which is unused
@@ -285,6 +285,7 @@ def types_that_cannot_be_forward_declared():
'WebCore::GraphicsContextGLAttributes',
'WebCore::ImageDecoderIdentifier',
'WebCore::LibWebRTCSocketIdentifier',
'WebCore::MediaKeySystemRequestIdentifier',
'WebCore::MediaPlayerIdentifier',
'WebCore::MediaSessionIdentifier',
'WebCore::NativeImageReference',
@@ -86,7 +86,7 @@ void MediaKeySystemPermissionRequestManagerProxy::denyRequest(MediaKeySystemPerm
if (!m_page.hasRunningProcess())
return;

ALWAYS_LOG(LOGIDENTIFIER, request.mediaKeySystemID(), ", reason: ", message);
ALWAYS_LOG(LOGIDENTIFIER, request.mediaKeySystemID().toUInt64(), ", reason: ", message);

#if ENABLE(ENCRYPTED_MEDIA)
m_page.send(Messages::WebPage::MediaKeySystemWasDenied(request.mediaKeySystemID(), message));
@@ -101,17 +101,17 @@ void MediaKeySystemPermissionRequestManagerProxy::grantRequest(MediaKeySystemPer
return;

#if ENABLE(ENCRYPTED_MEDIA)
ALWAYS_LOG(LOGIDENTIFIER, request.mediaKeySystemID(), ", keySystem: ", request.keySystem());
ALWAYS_LOG(LOGIDENTIFIER, request.mediaKeySystemID().toUInt64(), ", keySystem: ", request.keySystem());

m_page.sendWithAsyncReply(Messages::WebPage::MediaKeySystemWasGranted { request.mediaKeySystemID() }, [] { });
#else
UNUSED_PARAM(request);
#endif
}

Ref<MediaKeySystemPermissionRequestProxy> MediaKeySystemPermissionRequestManagerProxy::createRequestForFrame(uint64_t mediaKeySystemID, FrameIdentifier frameID, Ref<SecurityOrigin>&& topLevelDocumentOrigin, const String& keySystem)
Ref<MediaKeySystemPermissionRequestProxy> MediaKeySystemPermissionRequestManagerProxy::createRequestForFrame(MediaKeySystemRequestIdentifier mediaKeySystemID, FrameIdentifier frameID, Ref<SecurityOrigin>&& topLevelDocumentOrigin, const String& keySystem)
{
ALWAYS_LOG(LOGIDENTIFIER, mediaKeySystemID);
ALWAYS_LOG(LOGIDENTIFIER, mediaKeySystemID.toUInt64());

auto request = MediaKeySystemPermissionRequestProxy::create(*this, mediaKeySystemID, m_page.mainFrame()->frameID(), frameID, WTFMove(topLevelDocumentOrigin), keySystem);
m_pendingRequests.add(mediaKeySystemID, request.ptr());
@@ -51,7 +51,7 @@ class MediaKeySystemPermissionRequestManagerProxy : public CanMakeWeakPtr<MediaK

void invalidatePendingRequests();

Ref<MediaKeySystemPermissionRequestProxy> createRequestForFrame(uint64_t mediaKeySystemID, WebCore::FrameIdentifier, Ref<WebCore::SecurityOrigin>&& topLevelDocumentOrigin, const String& keySystem);
Ref<MediaKeySystemPermissionRequestProxy> createRequestForFrame(WebCore::MediaKeySystemRequestIdentifier, WebCore::FrameIdentifier, Ref<WebCore::SecurityOrigin>&& topLevelDocumentOrigin, const String& keySystem);

void grantRequest(MediaKeySystemPermissionRequestProxy&);
void denyRequest(MediaKeySystemPermissionRequestProxy&, const String& message = { });
@@ -64,7 +64,7 @@ class MediaKeySystemPermissionRequestManagerProxy : public CanMakeWeakPtr<MediaK

WebPageProxy& m_page;

HashMap<uint64_t, RefPtr<MediaKeySystemPermissionRequestProxy>> m_pendingRequests;
HashMap<WebCore::MediaKeySystemRequestIdentifier, RefPtr<MediaKeySystemPermissionRequestProxy>> m_pendingRequests;
HashSet<String> m_validAuthorizationTokens;

#if !RELEASE_LOG_DISABLED
@@ -34,7 +34,7 @@
namespace WebKit {
using namespace WebCore;

MediaKeySystemPermissionRequestProxy::MediaKeySystemPermissionRequestProxy(MediaKeySystemPermissionRequestManagerProxy& manager, uint64_t mediaKeySystemID, FrameIdentifier mainFrameID, FrameIdentifier frameID, Ref<WebCore::SecurityOrigin>&& topLevelDocumentOrigin, const String& keySystem)
MediaKeySystemPermissionRequestProxy::MediaKeySystemPermissionRequestProxy(MediaKeySystemPermissionRequestManagerProxy& manager, MediaKeySystemRequestIdentifier mediaKeySystemID, FrameIdentifier mainFrameID, FrameIdentifier frameID, Ref<WebCore::SecurityOrigin>&& topLevelDocumentOrigin, const String& keySystem)
: m_manager(makeWeakPtr(manager))
, m_mediaKeySystemID(mediaKeySystemID)
, m_mainFrameID(mainFrameID)
@@ -27,6 +27,8 @@

#include "APIObject.h"
#include <WebCore/FrameIdentifier.h>
#include <WebCore/MediaKeySystemRequest.h>
#include <WebCore/MediaKeySystemRequestIdentifier.h>
#include <wtf/Vector.h>
#include <wtf/WeakPtr.h>
#include <wtf/text/WTFString.h>
@@ -41,7 +43,7 @@ class MediaKeySystemPermissionRequestManagerProxy;

class MediaKeySystemPermissionRequestProxy : public RefCounted<MediaKeySystemPermissionRequestProxy> {
public:
static Ref<MediaKeySystemPermissionRequestProxy> create(MediaKeySystemPermissionRequestManagerProxy& manager, uint64_t mediaKeySystemID, WebCore::FrameIdentifier mainFrameID, WebCore::FrameIdentifier frameID, Ref<WebCore::SecurityOrigin>&& topLevelDocumentOrigin, const String& keySystem)
static Ref<MediaKeySystemPermissionRequestProxy> create(MediaKeySystemPermissionRequestManagerProxy& manager, WebCore::MediaKeySystemRequestIdentifier mediaKeySystemID, WebCore::FrameIdentifier mainFrameID, WebCore::FrameIdentifier frameID, Ref<WebCore::SecurityOrigin>&& topLevelDocumentOrigin, const String& keySystem)
{
return adoptRef(*new MediaKeySystemPermissionRequestProxy(manager, mediaKeySystemID, mainFrameID, frameID, WTFMove(topLevelDocumentOrigin), keySystem));
}
@@ -51,7 +53,7 @@ class MediaKeySystemPermissionRequestProxy : public RefCounted<MediaKeySystemPer

void invalidate();

uint64_t mediaKeySystemID() const { return m_mediaKeySystemID; }
WebCore::MediaKeySystemRequestIdentifier mediaKeySystemID() const { return m_mediaKeySystemID; }
WebCore::FrameIdentifier mainFrameID() const { return m_mainFrameID; }
WebCore::FrameIdentifier frameID() const { return m_frameID; }

@@ -63,10 +65,10 @@ class MediaKeySystemPermissionRequestProxy : public RefCounted<MediaKeySystemPer
void doDefaultAction();

private:
MediaKeySystemPermissionRequestProxy(MediaKeySystemPermissionRequestManagerProxy&, uint64_t mediaKeySystemID, WebCore::FrameIdentifier mainFrameID, WebCore::FrameIdentifier, Ref<WebCore::SecurityOrigin>&& topLevelDocumentOrigin, const String& keySystem);
MediaKeySystemPermissionRequestProxy(MediaKeySystemPermissionRequestManagerProxy&, WebCore::MediaKeySystemRequestIdentifier, WebCore::FrameIdentifier mainFrameID, WebCore::FrameIdentifier, Ref<WebCore::SecurityOrigin>&& topLevelDocumentOrigin, const String& keySystem);

WeakPtr<MediaKeySystemPermissionRequestManagerProxy> m_manager;
uint64_t m_mediaKeySystemID;
WebCore::MediaKeySystemRequestIdentifier m_mediaKeySystemID;
WebCore::FrameIdentifier m_mainFrameID;
WebCore::FrameIdentifier m_frameID;
Ref<WebCore::SecurityOrigin> m_topLevelDocumentSecurityOrigin;
@@ -8559,7 +8559,7 @@ void WebPageProxy::clearUserMediaState()
#endif
}

void WebPageProxy::requestMediaKeySystemPermissionForFrame(uint64_t mediaKeySystemID, FrameIdentifier frameID, const WebCore::SecurityOriginData& topLevelDocumentOriginData, const String& keySystem)
void WebPageProxy::requestMediaKeySystemPermissionForFrame(MediaKeySystemRequestIdentifier mediaKeySystemID, FrameIdentifier frameID, const WebCore::SecurityOriginData& topLevelDocumentOriginData, const String& keySystem)
{
#if ENABLE(ENCRYPTED_MEDIA)
MESSAGE_CHECK(m_process, m_process->webFrame(frameID));
@@ -2132,7 +2132,7 @@ class WebPageProxy final : public API::ObjectImpl<API::Object::Type::Page>
#if ENABLE(ENCRYPTED_MEDIA)
MediaKeySystemPermissionRequestManagerProxy& mediaKeySystemPermissionRequestManager();
#endif
void requestMediaKeySystemPermissionForFrame(uint64_t mediaKeySystemID, WebCore::FrameIdentifier, const WebCore::SecurityOriginData& topLevelDocumentOriginIdentifier, const String&);
void requestMediaKeySystemPermissionForFrame(WebCore::MediaKeySystemRequestIdentifier, WebCore::FrameIdentifier, const WebCore::SecurityOriginData& topLevelDocumentOriginIdentifier, const String&);

void runModal();
void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&);
@@ -275,7 +275,7 @@ messages -> WebPageProxy {
#endif

#if ENABLE(ENCRYPTED_MEDIA)
RequestMediaKeySystemPermissionForFrame(uint64_t mediaKeySystemID, WebCore::FrameIdentifier frameID, struct WebCore::SecurityOriginData topLevelDocumentOriginIdentifier, String keySystem)
RequestMediaKeySystemPermissionForFrame(WebCore::MediaKeySystemRequestIdentifier mediaKeySystemID, WebCore::FrameIdentifier frameID, struct WebCore::SecurityOriginData topLevelDocumentOriginIdentifier, String keySystem)
#endif

# Notification messages
@@ -82,7 +82,7 @@ void MediaKeySystemPermissionRequestManager::sendMediaKeySystemRequest(MediaKeyS
ASSERT(webFrame);

auto* topLevelDocumentOrigin = userRequest.topLevelDocumentOrigin();
m_page.send(Messages::WebPageProxy::RequestMediaKeySystemPermissionForFrame(userRequest.identifier().toUInt64(), webFrame->frameID(), topLevelDocumentOrigin->data(), userRequest.keySystem()));
m_page.send(Messages::WebPageProxy::RequestMediaKeySystemPermissionForFrame(userRequest.identifier(), webFrame->frameID(), topLevelDocumentOrigin->data(), userRequest.keySystem()));
}

void MediaKeySystemPermissionRequestManager::cancelMediaKeySystemRequest(MediaKeySystemRequest& request)
@@ -119,9 +119,9 @@ void MediaKeySystemPermissionRequestManager::mediaCanStart(Document& document)
sendMediaKeySystemRequest(pendingRequest);
}

void MediaKeySystemPermissionRequestManager::mediaKeySystemWasGranted(uint64_t requestID, CompletionHandler<void()>&& completionHandler)
void MediaKeySystemPermissionRequestManager::mediaKeySystemWasGranted(MediaKeySystemRequestIdentifier requestID, CompletionHandler<void()>&& completionHandler)
{
auto request = m_ongoingMediaKeySystemRequests.take(makeObjectIdentifier<MediaKeySystemRequestIdentifierType>(requestID));
auto request = m_ongoingMediaKeySystemRequests.take(requestID);
if (!request) {
completionHandler();
return;
@@ -130,9 +130,9 @@ void MediaKeySystemPermissionRequestManager::mediaKeySystemWasGranted(uint64_t r
request->allow(WTFMove(completionHandler));
}

void MediaKeySystemPermissionRequestManager::mediaKeySystemWasDenied(uint64_t requestID, String&& message)
void MediaKeySystemPermissionRequestManager::mediaKeySystemWasDenied(MediaKeySystemRequestIdentifier requestID, String&& message)
{
auto request = m_ongoingMediaKeySystemRequests.take(makeObjectIdentifier<MediaKeySystemRequestIdentifierType>(requestID));
auto request = m_ongoingMediaKeySystemRequests.take(requestID);
if (!request)
return;

@@ -47,8 +47,8 @@ class MediaKeySystemPermissionRequestManager : private WebCore::MediaCanStartLis

void startMediaKeySystemRequest(WebCore::MediaKeySystemRequest&);
void cancelMediaKeySystemRequest(WebCore::MediaKeySystemRequest&);
void mediaKeySystemWasGranted(uint64_t, CompletionHandler<void()>&&);
void mediaKeySystemWasDenied(uint64_t, String&&);
void mediaKeySystemWasGranted(WebCore::MediaKeySystemRequestIdentifier, CompletionHandler<void()>&&);
void mediaKeySystemWasDenied(WebCore::MediaKeySystemRequestIdentifier, String&&);

private:
void sendMediaKeySystemRequest(WebCore::MediaKeySystemRequest&);

0 comments on commit efbeef4

Please sign in to comment.