Title: [281157] trunk/Source
Revision
281157
Author
jer.no...@apple.com
Date
2021-08-17 12:34:28 -0700 (Tue, 17 Aug 2021)

Log Message

De-duplicate the Cocoa-specific MediaPlayerPrivateRemote constructor
https://bugs.webkit.org/show_bug.cgi?id=229193

Reviewed by Eric Carlson.

Source/WebCore:

Don't include a Objective-C header in a file which will be included by C++ source; forward-declare
the class instead.

* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h:
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:

Source/WebKit:

Rather than have two, separate implementations of the MediaPlayerPrivateRemote constructor (one for Cocoa),
just wrap the initializer for the Cocoa-specific ivar in PLATFORM(COCOA) guards.

* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote):
* WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
(WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (281156 => 281157)


--- trunk/Source/WebCore/ChangeLog	2021-08-17 19:23:23 UTC (rev 281156)
+++ trunk/Source/WebCore/ChangeLog	2021-08-17 19:34:28 UTC (rev 281157)
@@ -1,3 +1,16 @@
+2021-08-17  Jer Noble  <jer.no...@apple.com>
+
+        De-duplicate the Cocoa-specific MediaPlayerPrivateRemote constructor
+        https://bugs.webkit.org/show_bug.cgi?id=229193
+
+        Reviewed by Eric Carlson.
+
+        Don't include a Objective-C header in a file which will be included by C++ source; forward-declare
+        the class instead.
+
+        * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h:
+        * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
+
 2021-08-17  Alex Christensen  <achristen...@webkit.org>
 
         Document load events should update timing in PerformanceNavigationTiming even after its instantiation

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h (281156 => 281157)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h	2021-08-17 19:23:23 UTC (rev 281156)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h	2021-08-17 19:34:28 UTC (rev 281157)
@@ -30,12 +30,13 @@
 #include "NativeImage.h"
 #include "PlatformLayer.h"
 #include "VideoLayerManager.h"
-#include "WebVideoContainerLayer.h"
 #include <wtf/Function.h>
 #include <wtf/LoggerHelper.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/RetainPtr.h>
 
+OBJC_CLASS WebVideoContainerLayer;
+
 namespace WebCore {
 
 class VideoLayerManagerObjC final

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm (281156 => 281157)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm	2021-08-17 19:23:23 UTC (rev 281156)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm	2021-08-17 19:34:28 UTC (rev 281157)
@@ -30,6 +30,7 @@
 #import "Logging.h"
 #import "TextTrackRepresentation.h"
 #import "WebCoreCALayerExtras.h"
+#import "WebVideoContainerLayer.h"
 #import <mach/mach_init.h>
 #import <mach/mach_port.h>
 #import <pal/spi/cocoa/QuartzCoreSPI.h>

Modified: trunk/Source/WebKit/ChangeLog (281156 => 281157)


--- trunk/Source/WebKit/ChangeLog	2021-08-17 19:23:23 UTC (rev 281156)
+++ trunk/Source/WebKit/ChangeLog	2021-08-17 19:34:28 UTC (rev 281157)
@@ -1,3 +1,18 @@
+2021-08-17  Jer Noble  <jer.no...@apple.com>
+
+        De-duplicate the Cocoa-specific MediaPlayerPrivateRemote constructor
+        https://bugs.webkit.org/show_bug.cgi?id=229193
+
+        Reviewed by Eric Carlson.
+
+        Rather than have two, separate implementations of the MediaPlayerPrivateRemote constructor (one for Cocoa),
+        just wrap the initializer for the Cocoa-specific ivar in PLATFORM(COCOA) guards.
+
+        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
+        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote):
+        * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
+        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): Deleted.
+
 2021-08-16  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [GPU Process] Demote the release assertion in `RemoteResourceCache::ensureResourceUseCounter`

Modified: trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp (281156 => 281157)


--- trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp	2021-08-17 19:23:23 UTC (rev 281156)
+++ trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp	2021-08-17 19:34:28 UTC (rev 281157)
@@ -78,6 +78,10 @@
 #include "RemoteMediaSourceIdentifier.h"
 #endif
 
+#if PLATFORM(COCOA)
+#import <WebCore/VideoLayerManagerObjC.h>
+#endif
+
 namespace WebCore {
 #if !RELEASE_LOG_DISABLED
 extern WTFLogChannel LogMedia;
@@ -98,7 +102,6 @@
 } while (0)
 #endif
 
-#if !PLATFORM(COCOA)
 MediaPlayerPrivateRemote::MediaPlayerPrivateRemote(MediaPlayer* player, MediaPlayerEnums::MediaEngineIdentifier engineIdentifier, MediaPlayerIdentifier playerIdentifier, RemoteMediaPlayerManager& manager)
     :
 #if !RELEASE_LOG_DISABLED
@@ -108,6 +111,9 @@
 #endif
       m_player(makeWeakPtr(*player))
     , m_mediaResourceLoader(*player->createResourceLoader())
+#if PLATFORM(COCOA)
+    , m_videoLayerManager(makeUniqueRef<VideoLayerManagerObjC>(logger(), logIdentifier()))
+#endif
     , m_manager(manager)
     , m_remoteEngineIdentifier(engineIdentifier)
     , m_id(playerIdentifier)
@@ -117,7 +123,6 @@
 
     acceleratedRenderingStateChanged();
 }
-#endif
 
 MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote()
 {

Modified: trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm (281156 => 281157)


--- trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm	2021-08-17 19:23:23 UTC (rev 281156)
+++ trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm	2021-08-17 19:34:28 UTC (rev 281157)
@@ -33,7 +33,6 @@
 #import "WebCoreArgumentCoders.h"
 #import <WebCore/ColorSpaceCG.h>
 #import <WebCore/IOSurface.h>
-#import <WebCore/VideoLayerManagerObjC.h>
 #import <pal/spi/cocoa/QuartzCoreSPI.h>
 #import <wtf/MachSendRight.h>
 
@@ -40,23 +39,6 @@
 namespace WebKit {
 using namespace WebCore;
 
-MediaPlayerPrivateRemote::MediaPlayerPrivateRemote(MediaPlayer* player, MediaPlayerEnums::MediaEngineIdentifier engineIdentifier, MediaPlayerIdentifier playerIdentifier, RemoteMediaPlayerManager& manager)
-#if !RELEASE_LOG_DISABLED
-    : m_logger(player->mediaPlayerLogger())
-    , m_logIdentifier(player->mediaPlayerLogIdentifier())
-#endif
-    , m_player(makeWeakPtr(*player))
-    , m_mediaResourceLoader(*player->createResourceLoader())
-    , m_videoLayerManager(makeUniqueRef<VideoLayerManagerObjC>(logger(), logIdentifier()))
-    , m_manager(manager)
-    , m_remoteEngineIdentifier(engineIdentifier)
-    , m_id(playerIdentifier)
-{
-    INFO_LOG(LOGIDENTIFIER);
-
-    acceleratedRenderingStateChanged();
-}
-
 #if ENABLE(VIDEO_PRESENTATION_MODE)
 PlatformLayerContainer MediaPlayerPrivateRemote::createVideoFullscreenLayer()
 {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to