[MediaStream] RealtimeMediaSource should be able to vend hashed IDs
[WebKit-https.git] / Source / WebKit / UIProcess / UserMediaPermissionRequestManagerProxy.cpp
1 /*
2  * Copyright (C) 2014 Igalia S.L.
3  * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
4  *
5  *  This library is free software; you can redistribute it and/or
6  *  modify it under the terms of the GNU Lesser General Public
7  *  License as published by the Free Software Foundation; either
8  *  version 2 of the License, or (at your option) any later version.
9  *
10  *  This library is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  *  Lesser General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Lesser General Public
16  *  License along with this library; if not, write to the Free Software
17  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19
20 #include "config.h"
21 #include "UserMediaPermissionRequestManagerProxy.h"
22
23 #include "APISecurityOrigin.h"
24 #include "APIUIClient.h"
25 #include "UserMediaPermissionRequestManager.h"
26 #include "UserMediaProcessManager.h"
27 #include "WebAutomationSession.h"
28 #include "WebPageMessages.h"
29 #include "WebPageProxy.h"
30 #include "WebProcessPool.h"
31 #include "WebProcessProxy.h"
32 #include <WebCore/MediaConstraints.h>
33 #include <WebCore/MockRealtimeMediaSourceCenter.h>
34 #include <WebCore/RealtimeMediaSource.h>
35 #include <WebCore/SecurityOriginData.h>
36 #include <WebCore/UserMediaRequest.h>
37
38 namespace WebKit {
39 using namespace WebCore;
40
41 #if ENABLE(MEDIA_STREAM)
42 static const MediaProducer::MediaStateFlags activeCaptureMask = MediaProducer::HasActiveAudioCaptureDevice | MediaProducer::HasActiveVideoCaptureDevice;
43 #endif
44
45 UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy(WebPageProxy& page)
46     : m_page(page)
47     , m_rejectionTimer(RunLoop::main(), this, &UserMediaPermissionRequestManagerProxy::rejectionTimerFired)
48     , m_watchdogTimer(RunLoop::main(), this, &UserMediaPermissionRequestManagerProxy::watchdogTimerFired)
49 {
50 #if ENABLE(MEDIA_STREAM)
51     UserMediaProcessManager::singleton().addUserMediaPermissionRequestManagerProxy(*this);
52 #endif
53 }
54
55 UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy()
56 {
57 #if ENABLE(MEDIA_STREAM)
58     UserMediaProcessManager::singleton().removeUserMediaPermissionRequestManagerProxy(*this);
59 #endif
60     invalidatePendingRequests();
61 }
62
63 void UserMediaPermissionRequestManagerProxy::invalidatePendingRequests()
64 {
65     for (auto& request : m_pendingUserMediaRequests.values())
66         request->invalidate();
67     m_pendingUserMediaRequests.clear();
68
69     for (auto& request : m_pendingDeviceRequests.values())
70         request->invalidate();
71     m_pendingDeviceRequests.clear();
72 }
73
74 void UserMediaPermissionRequestManagerProxy::stopCapture()
75 {
76     invalidatePendingRequests();
77     m_page.stopMediaCapture();
78 }
79
80 void UserMediaPermissionRequestManagerProxy::captureDevicesChanged()
81 {
82 #if ENABLE(MEDIA_STREAM)
83     // FIXME: a page with persistent access should always get device change notifications.
84     auto accessState = m_grantedRequests.isEmpty() ? DeviceAccessState::NoAccess : DeviceAccessState::SessionAccess;
85     m_page.process().send(Messages::WebPage::CaptureDevicesChanged(accessState), m_page.pageID());
86 #endif
87 }
88
89 void UserMediaPermissionRequestManagerProxy::clearCachedState()
90 {
91     invalidatePendingRequests();
92 }
93
94 Ref<UserMediaPermissionRequestProxy> UserMediaPermissionRequestManagerProxy::createPermissionRequest(uint64_t userMediaID, uint64_t mainFrameID, uint64_t frameID, Ref<SecurityOrigin>&& userMediaDocumentOrigin, Ref<SecurityOrigin>&& topLevelDocumentOrigin, Vector<CaptureDevice>&& audioDevices, Vector<CaptureDevice>&& videoDevices, String&& deviceIDHashSalt, MediaStreamRequest&& request)
95 {
96     auto permissionRequest = UserMediaPermissionRequestProxy::create(*this, userMediaID, mainFrameID, frameID, WTFMove(userMediaDocumentOrigin), WTFMove(topLevelDocumentOrigin), WTFMove(audioDevices), WTFMove(videoDevices), WTFMove(deviceIDHashSalt), WTFMove(request));
97     m_pendingUserMediaRequests.add(userMediaID, permissionRequest.ptr());
98     return permissionRequest;
99 }
100
101 #if ENABLE(MEDIA_STREAM)
102 static uint64_t toWebCore(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason reason)
103 {
104     switch (reason) {
105     case UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::NoConstraints:
106         return static_cast<uint64_t>(UserMediaRequest::MediaAccessDenialReason::NoConstraints);
107     case UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::UserMediaDisabled:
108         return static_cast<uint64_t>(UserMediaRequest::MediaAccessDenialReason::UserMediaDisabled);
109     case UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::NoCaptureDevices:
110         return static_cast<uint64_t>(UserMediaRequest::MediaAccessDenialReason::NoCaptureDevices);
111     case UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::InvalidConstraint:
112         return static_cast<uint64_t>(UserMediaRequest::MediaAccessDenialReason::InvalidConstraint);
113     case UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::HardwareError:
114         return static_cast<uint64_t>(UserMediaRequest::MediaAccessDenialReason::HardwareError);
115     case UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::PermissionDenied:
116         return static_cast<uint64_t>(UserMediaRequest::MediaAccessDenialReason::PermissionDenied);
117     case UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::OtherFailure:
118         return static_cast<uint64_t>(UserMediaRequest::MediaAccessDenialReason::OtherFailure);
119     }
120
121     ASSERT_NOT_REACHED();
122     return static_cast<uint64_t>(UserMediaRequest::MediaAccessDenialReason::OtherFailure);
123 }
124 #endif
125
126 void UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied(uint64_t userMediaID, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason reason)
127 {
128     if (!m_page.isValid())
129         return;
130
131     auto request = m_pendingUserMediaRequests.take(userMediaID);
132     if (!request)
133         return;
134
135     if (reason == UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::PermissionDenied)
136         m_deniedRequests.append(DeniedRequest { request->mainFrameID(), request->userMediaDocumentSecurityOrigin(), request->topLevelDocumentSecurityOrigin(), request->requiresAudioCapture(), request->requiresVideoCapture() });
137
138     denyRequest(userMediaID, reason, emptyString());
139 }
140
141 void UserMediaPermissionRequestManagerProxy::denyRequest(uint64_t userMediaID, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason reason, const String& invalidConstraint)
142 {
143     ASSERT(m_page.isValid());
144
145 #if ENABLE(MEDIA_STREAM)
146     m_page.process().send(Messages::WebPage::UserMediaAccessWasDenied(userMediaID, toWebCore(reason), invalidConstraint), m_page.pageID());
147 #else
148     UNUSED_PARAM(reason);
149     UNUSED_PARAM(invalidConstraint);
150 #endif
151 }
152
153 void UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted(uint64_t userMediaID, CaptureDevice&& audioDevice, CaptureDevice&& videoDevice)
154 {
155     ASSERT(audioDevice || videoDevice);
156
157     if (!m_page.isValid())
158         return;
159
160 #if ENABLE(MEDIA_STREAM)
161     auto request = m_pendingUserMediaRequests.take(userMediaID);
162     if (!request)
163         return;
164
165     if (grantAccess(userMediaID, WTFMove(audioDevice), WTFMove(videoDevice), request->deviceIdentifierHashSalt()))
166         m_grantedRequests.append(request.releaseNonNull());
167
168 #else
169     UNUSED_PARAM(userMediaID);
170     UNUSED_PARAM(audioDevice);
171     UNUSED_PARAM(videoDevice);
172 #endif
173 }
174
175 #if ENABLE(MEDIA_STREAM)
176 void UserMediaPermissionRequestManagerProxy::resetAccess(uint64_t frameID)
177 {
178     m_grantedRequests.removeAllMatching([frameID](const auto& grantedRequest) {
179         return grantedRequest->mainFrameID() == frameID;
180     });
181     m_pregrantedRequests.clear();
182     m_deniedRequests.clear();
183 }
184
185 const UserMediaPermissionRequestProxy* UserMediaPermissionRequestManagerProxy::searchForGrantedRequest(uint64_t frameID, const SecurityOrigin& userMediaDocumentOrigin, const SecurityOrigin& topLevelDocumentOrigin, bool needsAudio, bool needsVideo) const
186 {
187     if (m_page.isMediaStreamCaptureMuted())
188         return nullptr;
189
190     bool checkForAudio = needsAudio;
191     bool checkForVideo = needsVideo;
192     for (const auto& grantedRequest : m_grantedRequests) {
193         if (grantedRequest->requiresDisplayCapture())
194             continue;
195         if (!grantedRequest->userMediaDocumentSecurityOrigin().isSameSchemeHostPort(userMediaDocumentOrigin))
196             continue;
197         if (!grantedRequest->topLevelDocumentSecurityOrigin().isSameSchemeHostPort(topLevelDocumentOrigin))
198             continue;
199         if (grantedRequest->frameID() != frameID)
200             continue;
201
202         if (grantedRequest->requiresVideoCapture())
203             checkForVideo = false;
204
205         if (grantedRequest->requiresAudioCapture())
206             checkForAudio = false;
207
208         if (checkForVideo || checkForAudio)
209             continue;
210
211         return grantedRequest.ptr();
212     }
213     return nullptr;
214 }
215
216 bool UserMediaPermissionRequestManagerProxy::wasRequestDenied(uint64_t mainFrameID, const SecurityOrigin& userMediaDocumentOrigin, const SecurityOrigin& topLevelDocumentOrigin, bool needsAudio, bool needsVideo)
217 {
218     for (const auto& deniedRequest : m_deniedRequests) {
219         if (!deniedRequest.userMediaDocumentOrigin->isSameSchemeHostPort(userMediaDocumentOrigin))
220             continue;
221         if (!deniedRequest.topLevelDocumentOrigin->isSameSchemeHostPort(topLevelDocumentOrigin))
222             continue;
223         if (deniedRequest.mainFrameID != mainFrameID)
224             continue;
225         if (deniedRequest.isAudioDenied && needsAudio)
226             return true;
227         if (deniedRequest.isVideoDenied && needsVideo)
228             return true;
229     }
230     return false;
231 }
232
233 bool UserMediaPermissionRequestManagerProxy::grantAccess(uint64_t userMediaID, const CaptureDevice audioDevice, const CaptureDevice videoDevice, const String& deviceIdentifierHashSalt)
234 {
235     if (!UserMediaProcessManager::singleton().willCreateMediaStream(*this, !!audioDevice, !!videoDevice)) {
236         denyRequest(userMediaID, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::OtherFailure, "Unable to extend sandbox.");
237         return false;
238     }
239
240     m_page.process().send(Messages::WebPage::UserMediaAccessWasGranted(userMediaID, audioDevice, videoDevice, deviceIdentifierHashSalt), m_page.pageID());
241     return true;
242 }
243 #endif
244
245 void UserMediaPermissionRequestManagerProxy::rejectionTimerFired()
246 {
247     uint64_t userMediaID = m_pendingRejections[0];
248     m_pendingRejections.remove(0);
249
250     denyRequest(userMediaID, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::PermissionDenied, emptyString());
251     if (!m_pendingRejections.isEmpty())
252         scheduleNextRejection();
253 }
254
255 void UserMediaPermissionRequestManagerProxy::scheduleNextRejection()
256 {
257     const double mimimumDelayBeforeReplying = .25;
258     if (!m_rejectionTimer.isActive())
259         m_rejectionTimer.startOneShot(Seconds(mimimumDelayBeforeReplying + randomNumber()));
260 }
261
262 void UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, Ref<SecurityOrigin>&& userMediaDocumentOrigin, Ref<SecurityOrigin>&& topLevelDocumentOrigin, const MediaStreamRequest& userRequest)
263 {
264 #if ENABLE(MEDIA_STREAM)
265     if (!UserMediaProcessManager::singleton().captureEnabled()) {
266         m_pendingRejections.append(userMediaID);
267         scheduleNextRejection();
268         return;
269     }
270
271     RealtimeMediaSourceCenter::InvalidConstraintsHandler invalidHandler = [this, userMediaID](const String& invalidConstraint) {
272         if (!m_page.isValid())
273             return;
274
275         denyRequest(userMediaID, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::InvalidConstraint, invalidConstraint);
276     };
277
278     auto validHandler = [this, userMediaID, frameID, userMediaDocumentOrigin = userMediaDocumentOrigin.copyRef(), topLevelDocumentOrigin = topLevelDocumentOrigin.copyRef(), localUserRequest = userRequest](Vector<CaptureDevice>&& audioDevices, Vector<CaptureDevice>&& videoDevices, String&& deviceIdentifierHashSalt) mutable {
279         if (!m_page.isValid() || !m_page.mainFrame())
280             return;
281
282         if (videoDevices.isEmpty() && audioDevices.isEmpty()) {
283             denyRequest(userMediaID, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::NoConstraints, emptyString());
284             return;
285         }
286
287         if (wasRequestDenied(m_page.mainFrame()->frameID(), userMediaDocumentOrigin.get(), topLevelDocumentOrigin.get(), !audioDevices.isEmpty(), !videoDevices.isEmpty())) {
288             denyRequest(userMediaID, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::PermissionDenied, emptyString());
289             return;
290         }
291
292         auto* grantedRequest = searchForGrantedRequest(frameID, userMediaDocumentOrigin.get(), topLevelDocumentOrigin.get(), !audioDevices.isEmpty(), !videoDevices.isEmpty());
293         if (grantedRequest) {
294             if (m_page.isViewVisible()) {
295             // We select the first available devices, but the current client API allows client to select which device to pick.
296             // FIXME: Remove the possiblity for the client to do the device selection.
297                 auto audioDevice = !audioDevices.isEmpty() ? audioDevices[0] : CaptureDevice();
298                 auto videoDevice = !videoDevices.isEmpty() ? videoDevices[0] : CaptureDevice();
299                 grantAccess(userMediaID, WTFMove(audioDevice), WTFMove(videoDevice), grantedRequest->deviceIdentifierHashSalt());
300             } else
301                 m_pregrantedRequests.append(createPermissionRequest(userMediaID, m_page.mainFrame()->frameID(), frameID, WTFMove(userMediaDocumentOrigin), WTFMove(topLevelDocumentOrigin), WTFMove(audioDevices), WTFMove(videoDevices), String(grantedRequest->deviceIdentifierHashSalt()), WTFMove(localUserRequest)));
302
303             return;
304         }
305         auto userMediaOrigin = API::SecurityOrigin::create(userMediaDocumentOrigin.get());
306         auto topLevelOrigin = API::SecurityOrigin::create(topLevelDocumentOrigin.get());
307
308         auto pendingRequest = createPermissionRequest(userMediaID, m_page.mainFrame()->frameID(), frameID, WTFMove(userMediaDocumentOrigin), WTFMove(topLevelDocumentOrigin), WTFMove(audioDevices), WTFMove(videoDevices), WTFMove(deviceIdentifierHashSalt), WTFMove(localUserRequest));
309
310         if (m_page.isControlledByAutomation()) {
311             if (WebAutomationSession* automationSession = m_page.process().processPool().automationSession()) {
312                 if (automationSession->shouldAllowGetUserMediaForPage(m_page))
313                     pendingRequest->allow();
314                 else
315                     userMediaAccessWasDenied(userMediaID, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::PermissionDenied);
316
317                 return;
318             }
319         }
320
321         if (m_page.preferences().mockCaptureDevicesEnabled() && !m_page.preferences().mockCaptureDevicesPromptEnabled()) {
322             pendingRequest->allow();
323             return;
324         }
325
326         if (!m_page.uiClient().decidePolicyForUserMediaPermissionRequest(m_page, *m_page.process().webFrame(frameID), WTFMove(userMediaOrigin), WTFMove(topLevelOrigin), pendingRequest.get()))
327             userMediaAccessWasDenied(userMediaID, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::UserMediaDisabled);
328     };
329
330     auto haveDeviceSaltHandler = [this, validHandler = WTFMove(validHandler), invalidHandler = WTFMove(invalidHandler), localUserRequest = userRequest](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable {
331
332         auto pendingRequest = m_pendingDeviceRequests.take(userMediaID);
333         if (!pendingRequest)
334             return;
335
336         if (!m_page.isValid())
337             return;
338         
339         syncWithWebCorePrefs();
340         
341         RealtimeMediaSourceCenter::singleton().validateRequestConstraints(WTFMove(validHandler), WTFMove(invalidHandler), WTFMove(localUserRequest), WTFMove(deviceIdentifierHashSalt));
342     };
343
344     getUserMediaPermissionInfo(userMediaID, frameID, WTFMove(haveDeviceSaltHandler), WTFMove(userMediaDocumentOrigin), WTFMove(topLevelDocumentOrigin));
345 #else
346     UNUSED_PARAM(userMediaID);
347     UNUSED_PARAM(frameID);
348     UNUSED_PARAM(userMediaDocumentOrigin);
349     UNUSED_PARAM(topLevelDocumentOrigin);
350     UNUSED_PARAM(userRequest);
351 #endif
352 }
353
354 #if ENABLE(MEDIA_STREAM)
355 void UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo(uint64_t userMediaID, uint64_t frameID, UserMediaPermissionCheckProxy::CompletionHandler&& handler, Ref<SecurityOrigin>&& userMediaDocumentOrigin, Ref<SecurityOrigin>&& topLevelDocumentOrigin)
356 {
357     auto userMediaOrigin = API::SecurityOrigin::create(userMediaDocumentOrigin.get());
358     auto topLevelOrigin = API::SecurityOrigin::create(topLevelDocumentOrigin.get());
359
360     auto request = UserMediaPermissionCheckProxy::create(userMediaID, frameID, WTFMove(handler), WTFMove(userMediaDocumentOrigin), WTFMove(topLevelDocumentOrigin));
361     m_pendingDeviceRequests.add(userMediaID, request.copyRef());
362
363     if (!m_page.uiClient().checkUserMediaPermissionForOrigin(m_page, *m_page.process().webFrame(frameID), userMediaOrigin.get(), topLevelOrigin.get(), request.get()))
364         request->completionHandler()(userMediaID, String(), false);
365
366 #endif
367
368 void UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame(uint64_t userMediaID, uint64_t frameID, Ref<SecurityOrigin>&& userMediaDocumentOrigin, Ref<SecurityOrigin>&& topLevelDocumentOrigin)
369 {
370 #if ENABLE(MEDIA_STREAM)
371     auto completionHandler = [this](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) {
372         auto request = m_pendingDeviceRequests.take(userMediaID);
373         if (!request)
374             return;
375
376         if (!m_page.isValid())
377             return;
378
379         syncWithWebCorePrefs();
380
381         auto devices = RealtimeMediaSourceCenter::singleton().getMediaStreamDevices();
382         devices.removeAllMatching([&](auto& device) -> bool {
383             return !device.enabled() || (device.type() != WebCore::CaptureDevice::DeviceType::Camera && device.type() != WebCore::CaptureDevice::DeviceType::Microphone);
384         });
385
386         m_page.process().send(Messages::WebPage::DidCompleteMediaDeviceEnumeration(userMediaID, devices, deviceIdentifierHashSalt, originHasPersistentAccess), m_page.pageID());
387     };
388
389     getUserMediaPermissionInfo(userMediaID, frameID, WTFMove(completionHandler), WTFMove(userMediaDocumentOrigin), WTFMove(topLevelDocumentOrigin));
390 #else
391     UNUSED_PARAM(userMediaID);
392     UNUSED_PARAM(frameID);
393     UNUSED_PARAM(userMediaDocumentOrigin);
394     UNUSED_PARAM(topLevelDocumentOrigin);
395 #endif
396 }
397
398 void UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs() const
399 {
400 #if ENABLE(MEDIA_STREAM)
401     // Enable/disable the mock capture devices for the UI process as per the WebCore preferences. Note that
402     // this is a noop if the preference hasn't changed since the last time this was called.
403     bool mockDevicesEnabled = m_page.preferences().mockCaptureDevicesEnabled();
404     MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled(mockDevicesEnabled);
405 #endif
406 }
407
408 void UserMediaPermissionRequestManagerProxy::captureStateChanged(MediaProducer::MediaStateFlags oldState, MediaProducer::MediaStateFlags newState)
409 {
410     if (!m_page.isValid())
411         return;
412
413 #if ENABLE(MEDIA_STREAM)
414     bool wasCapturingAudio = oldState & MediaProducer::AudioCaptureMask;
415     bool wasCapturingVideo = oldState & MediaProducer::VideoCaptureMask;
416     bool isCapturingAudio = newState & MediaProducer::AudioCaptureMask;
417     bool isCapturingVideo = newState & MediaProducer::VideoCaptureMask;
418
419     if ((wasCapturingAudio && !isCapturingAudio) || (wasCapturingVideo && !isCapturingVideo))
420         UserMediaProcessManager::singleton().endedCaptureSession(*this);
421     if ((!wasCapturingAudio && isCapturingAudio) || (!wasCapturingVideo && isCapturingVideo))
422         UserMediaProcessManager::singleton().startedCaptureSession(*this);
423
424     if (m_captureState == (newState & activeCaptureMask))
425         return;
426
427     m_captureState = newState & activeCaptureMask;
428
429     Seconds interval;
430     if (m_captureState & activeCaptureMask)
431         interval = Seconds::fromHours(m_page.preferences().longRunningMediaCaptureStreamRepromptIntervalInHours());
432     else
433         interval = Seconds::fromMinutes(m_page.preferences().inactiveMediaCaptureSteamRepromptIntervalInMinutes());
434
435     if (interval == m_currentWatchdogInterval)
436         return;
437
438     m_currentWatchdogInterval = interval;
439     m_watchdogTimer.startOneShot(m_currentWatchdogInterval);
440 #endif
441 }
442
443 void UserMediaPermissionRequestManagerProxy::viewIsBecomingVisible()
444 {
445     for (auto& request : m_pregrantedRequests)
446         request->allow();
447     m_pregrantedRequests.clear();
448 }
449
450 void UserMediaPermissionRequestManagerProxy::watchdogTimerFired()
451 {
452     m_grantedRequests.clear();
453     m_pregrantedRequests.clear();
454     m_currentWatchdogInterval = 0_s;
455 }
456
457 } // namespace WebKit