Always log when granting/revoking capture sandbox extensions
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Sep 2018 17:32:42 +0000 (17:32 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Sep 2018 17:32:42 +0000 (17:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189701
<rdar://problem/44564029>

Reviewed by Youenn Fablet.

* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream): Always log.
(WebKit::UserMediaProcessManager::endedCaptureSession): Ditto.

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Ditto.
(WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236145 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/UserMediaProcessManager.cpp
Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp

index c95d8bf..bc62f35 100644 (file)
@@ -1,3 +1,19 @@
+2018-09-18  Eric Carlson  <eric.carlson@apple.com>
+
+        Always log when granting/revoking capture sandbox extensions
+        https://bugs.webkit.org/show_bug.cgi?id=189701
+        <rdar://problem/44564029>
+
+        Reviewed by Youenn Fablet.
+
+        * UIProcess/UserMediaProcessManager.cpp:
+        (WebKit::UserMediaProcessManager::willCreateMediaStream): Always log.
+        (WebKit::UserMediaProcessManager::endedCaptureSession): Ditto.
+
+        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
+        (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Ditto.
+        (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Ditto.
+
 2018-09-18  Youenn Fablet  <youenn@apple.com>
 
         Enable Unified Plan by default
index 7025d4d..876f4bf 100644 (file)
@@ -21,6 +21,7 @@
 
 #if ENABLE(MEDIA_STREAM)
 
+#include "Logging.h"
 #include "MediaDeviceSandboxExtensions.h"
 #include "WebPageMessages.h"
 #include "WebPageProxy.h"
@@ -189,6 +190,9 @@ bool UserMediaProcessManager::willCreateMediaStream(UserMediaPermissionRequestMa
             return false;
         }
 
+        for (const auto& id : ids)
+            RELEASE_LOG(WebRTC, "UserMediaProcessManager::willCreateMediaStream - granting extension %s", id.utf8().data());
+
         if (withAudio)
             state.grantAudioExtension();
         if (withVideo)
@@ -242,6 +246,9 @@ void UserMediaProcessManager::endedCaptureSession(UserMediaPermissionRequestMana
     if (params.isEmpty())
         return;
 
+    for (const auto& id : params)
+        RELEASE_LOG(WebRTC, "UserMediaProcessManager::endedCaptureSession - revoking extension %s", id.utf8().data());
+
     proxy.page().process().send(Messages::WebPage::RevokeUserMediaDeviceSandboxExtensions(params), proxy.page().pageID());
 #endif
 }
index 7148fed..81824b0 100644 (file)
@@ -22,6 +22,7 @@
 
 #if ENABLE(MEDIA_STREAM)
 
+#include "Logging.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebFrame.h"
 #include "WebPage.h"
@@ -210,6 +211,7 @@ void UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions(Me
     for (size_t i = 0; i < extensions.size(); i++) {
         const auto& extension = extensions[i];
         extension.second->consume();
+        RELEASE_LOG(WebRTC, "UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions - granted extension %s", extension.first.utf8().data());
         m_userMediaDeviceSandboxExtensions.add(extension.first, extension.second.copyRef());
     }
 }
@@ -218,8 +220,10 @@ void UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions(c
 {
     for (const auto& extensionID : extensionIDs) {
         auto extension = m_userMediaDeviceSandboxExtensions.take(extensionID);
-        if (extension)
+        if (extension) {
             extension->revoke();
+            RELEASE_LOG(WebRTC, "UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions - revoked extension %s", extensionID.utf8().data());
+        }
     }
 }