Title: [257919] trunk/Source
Revision
257919
Author
[email protected]
Date
2020-03-05 09:13:01 -0800 (Thu, 05 Mar 2020)

Log Message

Add logging support for capture sources in GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=208637

Reviewed by Eric Carlson.

Source/WebCore:

Make sure RealtimeVideoSource propagates its logger to its underlying source and to its clones.
No change of behavior.

* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::clone):
(WebCore::RealtimeVideoSource::setLogger):
* platform/mediastream/RealtimeVideoSource.h:

Source/WebKit:

Add a logger getter to the ConnectionProxy.
Implement it for GPUProcess and UIProcess.
Set source logger to the connection proxy logger.

* GPUProcess/GPUConnectionToWebProcess.cpp:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/WebProcessProxy.cpp:
* UIProcess/WebProcessProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (257918 => 257919)


--- trunk/Source/WebCore/ChangeLog	2020-03-05 16:13:57 UTC (rev 257918)
+++ trunk/Source/WebCore/ChangeLog	2020-03-05 17:13:01 UTC (rev 257919)
@@ -1,3 +1,19 @@
+2020-03-05  youenn fablet  <[email protected]>
+
+        Add logging support for capture sources in GPUProcess
+        https://bugs.webkit.org/show_bug.cgi?id=208637
+
+        Reviewed by Eric Carlson.
+
+        Make sure RealtimeVideoSource propagates its logger to its underlying source and to its clones.
+        No change of behavior.
+
+        * platform/mediastream/RealtimeMediaSource.h:
+        * platform/mediastream/RealtimeVideoSource.cpp:
+        (WebCore::RealtimeVideoSource::clone):
+        (WebCore::RealtimeVideoSource::setLogger):
+        * platform/mediastream/RealtimeVideoSource.h:
+
 2020-03-05  Wenson Hsieh  <[email protected]>
 
         Optimize Path::encode on platforms that support CGPathGetNumberOfElements

Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h (257918 => 257919)


--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h	2020-03-05 16:13:57 UTC (rev 257918)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h	2020-03-05 17:13:01 UTC (rev 257919)
@@ -70,7 +70,7 @@
     : public ThreadSafeRefCounted<RealtimeMediaSource, WTF::DestructionThread::MainRunLoop>
     , public CanMakeWeakPtr<RealtimeMediaSource>
 #if !RELEASE_LOG_DISABLED
-    , private LoggerHelper
+    , protected LoggerHelper
 #endif
 {
 public:
@@ -185,7 +185,7 @@
     virtual bool isIncomingVideoSource() const { return false; }
 
 #if !RELEASE_LOG_DISABLED
-    void setLogger(const Logger&, const void*);
+    virtual void setLogger(const Logger&, const void*);
     const Logger* loggerPtr() const { return m_logger.get(); }
     const Logger& logger() const final { ASSERT(m_logger); return *m_logger.get(); }
     const void* logIdentifier() const final { return m_logIdentifier; }

Modified: trunk/Source/WebCore/platform/mediastream/RealtimeVideoSource.cpp (257918 => 257919)


--- trunk/Source/WebCore/platform/mediastream/RealtimeVideoSource.cpp	2020-03-05 16:13:57 UTC (rev 257918)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeVideoSource.cpp	2020-03-05 17:13:01 UTC (rev 257919)
@@ -156,9 +156,20 @@
     auto source = create(m_source.copyRef());
     source->m_currentSettings = m_currentSettings;
     source->setSize(size());
+#if !RELEASE_LOG_DISABLED
+    source->setLogger(logger(), childLogIdentifier(logIdentifier(), ++m_cloneCounter));
+#endif
     return source;
 }
 
+#if !RELEASE_LOG_DISABLED
+void RealtimeVideoSource::setLogger(const Logger& logger, const void* identifier)
+{
+    RealtimeMediaSource::setLogger(logger, identifier);
+    m_source->setLogger(logger, identifier);
+}
+#endif
+
 } // namespace WebCore
 
 #endif // ENABLE(MEDIA_STREAM)

Modified: trunk/Source/WebCore/platform/mediastream/RealtimeVideoSource.h (257918 => 257919)


--- trunk/Source/WebCore/platform/mediastream/RealtimeVideoSource.h	2020-03-05 16:13:57 UTC (rev 257918)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeVideoSource.h	2020-03-05 17:13:01 UTC (rev 257919)
@@ -64,8 +64,13 @@
     bool preventSourceFromStopping() final;
     void videoSampleAvailable(MediaSample&) final;
 
+#if !RELEASE_LOG_DISABLED
+    void setLogger(const Logger&, const void*) final;
+#endif
+
     Ref<RealtimeVideoCaptureSource> m_source;
     RealtimeMediaSourceSettings m_currentSettings;
+    uint64_t m_cloneCounter { 0 };
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebKit/ChangeLog (257918 => 257919)


--- trunk/Source/WebKit/ChangeLog	2020-03-05 16:13:57 UTC (rev 257918)
+++ trunk/Source/WebKit/ChangeLog	2020-03-05 17:13:01 UTC (rev 257919)
@@ -1,3 +1,21 @@
+2020-03-05  youenn fablet  <[email protected]>
+
+        Add logging support for capture sources in GPUProcess
+        https://bugs.webkit.org/show_bug.cgi?id=208637
+
+        Reviewed by Eric Carlson.
+
+        Add a logger getter to the ConnectionProxy.
+        Implement it for GPUProcess and UIProcess.
+        Set source logger to the connection proxy logger.
+
+        * GPUProcess/GPUConnectionToWebProcess.cpp:
+        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
+        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
+        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
+        * UIProcess/WebProcessProxy.cpp:
+        * UIProcess/WebProcessProxy.h:
+
 2020-03-05  Youenn Fablet  <[email protected]>
 
         Export NowPlaying commands to GPUProcess when media playing in GPUProcess is enabled

Modified: trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp (257918 => 257919)


--- trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp	2020-03-05 16:13:57 UTC (rev 257918)
+++ trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp	2020-03-05 17:13:01 UTC (rev 257919)
@@ -90,6 +90,7 @@
     }
 
 private:
+    Logger& logger() final { return m_process.logger(); }
     void addMessageReceiver(IPC::StringReference messageReceiverName, IPC::MessageReceiver& receiver) final { }
     void removeMessageReceiver(IPC::StringReference messageReceiverName) final { }
     IPC::Connection& connection() final { return m_process.connection(); }

Modified: trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp (257918 => 257919)


--- trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp	2020-03-05 16:13:57 UTC (rev 257918)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp	2020-03-05 17:13:01 UTC (rev 257919)
@@ -205,6 +205,9 @@
     WebCore::RealtimeMediaSourceSettings settings;
     if (sourceOrError) {
         auto source = sourceOrError.source();
+#if !RELEASE_LOG_DISABLED
+        source->setLogger(m_connectionProxy->logger(), LoggerHelper::uniqueLogIdentifier());
+#endif
         settings = source->settings();
         ASSERT(!m_proxies.contains(id));
         m_proxies.add(id, makeUnique<SourceProxy>(id, m_connectionProxy->connection(), WTFMove(source)));

Modified: trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h (257918 => 257919)


--- trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h	2020-03-05 16:13:57 UTC (rev 257918)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h	2020-03-05 17:13:01 UTC (rev 257919)
@@ -54,6 +54,7 @@
         virtual void removeMessageReceiver(IPC::StringReference) = 0;
         virtual IPC::Connection& connection() = 0;
         virtual void willStartCameraCapture() { }
+        virtual Logger& logger() = 0;
     };
     explicit UserMediaCaptureManagerProxy(UniqueRef<ConnectionProxy>&&);
     ~UserMediaCaptureManagerProxy();

Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp (257918 => 257919)


--- trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2020-03-05 16:13:57 UTC (rev 257918)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2020-03-05 17:13:01 UTC (rev 257919)
@@ -160,7 +160,16 @@
     void addMessageReceiver(IPC::StringReference messageReceiverName, IPC::MessageReceiver& receiver) final { m_process.addMessageReceiver(messageReceiverName, receiver); }
     void removeMessageReceiver(IPC::StringReference messageReceiverName) final { m_process.removeMessageReceiver(messageReceiverName); }
     IPC::Connection& connection() final { return *m_process.connection(); }
+    Logger& logger() final
+    {
+        if (!m_logger) {
+            m_logger = Logger::create(this);
+            m_logger->setEnabled(this, m_process.sessionID().isAlwaysOnLoggingAllowed());
+        }
+        return *m_logger;
+    }
 
+    RefPtr<Logger> m_logger;
     WebProcessProxy& m_process;
 };
 #endif

Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.h (257918 => 257919)


--- trunk/Source/WebKit/UIProcess/WebProcessProxy.h	2020-03-05 16:13:57 UTC (rev 257918)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.h	2020-03-05 17:13:01 UTC (rev 257919)
@@ -51,6 +51,7 @@
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
+#include <wtf/Logger.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/WeakHashSet.h>
@@ -567,6 +568,7 @@
 #if PLATFORM(COCOA)
     MediaCaptureSandboxExtensions m_mediaCaptureSandboxExtensions { SandboxExtensionType::None };
 #endif
+    RefPtr<Logger> m_logger;
 
     struct ServiceWorkerInformation {
         WebPageProxyIdentifier serviceWorkerPageProxyID;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to