<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[282820] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/282820">282820</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2021-09-21 08:55:59 -0700 (Tue, 21 Sep 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove unused CGWindowCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=230520
<rdar://problem/83329399>

Reviewed by David Kilzer.

Remove CGWindowCaptureSource as it can't be used.

No new tests, no functional change.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/CGWindowCaptureSource.h: Removed.
* platform/mediastream/mac/CGWindowCaptureSource.mm: Removed.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::updateWindowCaptureDevices):
(WebCore::DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID):
* platform/mediastream/mac/DisplayCaptureSourceMac.cpp:
(WebCore::DisplayCaptureSourceMac::create):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreSourcesCocoatxt">trunk/Source/WebCore/SourcesCocoa.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacDisplayCaptureManagerCocoacpp">trunk/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacDisplayCaptureSourceMaccpp">trunk/Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceMac.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformmediastreammacCGWindowCaptureSourceh">trunk/Source/WebCore/platform/mediastream/mac/CGWindowCaptureSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacCGWindowCaptureSourcemm">trunk/Source/WebCore/platform/mediastream/mac/CGWindowCaptureSource.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (282819 => 282820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-09-21 15:38:30 UTC (rev 282819)
+++ trunk/Source/WebCore/ChangeLog      2021-09-21 15:55:59 UTC (rev 282820)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2021-09-21  Eric Carlson  <eric.carlson@apple.com>
+
+        Remove unused CGWindowCaptureSource
+        https://bugs.webkit.org/show_bug.cgi?id=230520
+        <rdar://problem/83329399>
+
+        Reviewed by David Kilzer.
+
+        Remove CGWindowCaptureSource as it can't be used.
+
+        No new tests, no functional change.
+
+        * SourcesCocoa.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/mediastream/mac/CGWindowCaptureSource.h: Removed.
+        * platform/mediastream/mac/CGWindowCaptureSource.mm: Removed.
+        * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
+        (WebCore::DisplayCaptureManagerCocoa::updateWindowCaptureDevices):
+        (WebCore::DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID):
+        * platform/mediastream/mac/DisplayCaptureSourceMac.cpp:
+        (WebCore::DisplayCaptureSourceMac::create):
+
</ins><span class="cx"> 2021-09-21  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Use typed identifier for WebSocketChannel identifiers
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcesCocoatxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/SourcesCocoa.txt (282819 => 282820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/SourcesCocoa.txt    2021-09-21 15:38:30 UTC (rev 282819)
+++ trunk/Source/WebCore/SourcesCocoa.txt       2021-09-21 15:55:59 UTC (rev 282820)
</span><span class="lines">@@ -528,7 +528,6 @@
</span><span class="cx"> platform/mediastream/mac/BaseAudioSharedUnit.cpp
</span><span class="cx"> platform/mediastream/mac/CGDisplayStreamCaptureSource.cpp
</span><span class="cx"> platform/mediastream/mac/CGDisplayStreamScreenCaptureSource.mm
</span><del>-platform/mediastream/mac/CGWindowCaptureSource.mm
</del><span class="cx"> platform/mediastream/mac/CoreAudioCaptureDevice.cpp
</span><span class="cx"> platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp
</span><span class="cx"> platform/mediastream/mac/CoreAudioCaptureSource.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (282819 => 282820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-09-21 15:38:30 UTC (rev 282819)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-09-21 15:55:59 UTC (rev 282820)
</span><span class="lines">@@ -8052,9 +8052,7 @@
</span><span class="cx">          416EDBFF2600E78700092675 /* RTCDataChannelIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDataChannelIdentifier.h; sourceTree = "<group>"; };
</span><span class="cx">          416EDC012600E7B000092675 /* RTCDataChannelRemoteHandlerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDataChannelRemoteHandlerConnection.h; sourceTree = "<group>"; };
</span><span class="cx">          416EDC032600E80F00092675 /* RTCDataChannelRemoteSourceConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDataChannelRemoteSourceConnection.h; sourceTree = "<group>"; };
</span><del>-               416F807924509F3200B68F02 /* CGWindowCaptureSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGWindowCaptureSource.h; sourceTree = "<group>"; };
</del><span class="cx">           416F807A24509F3200B68F02 /* CGDisplayStreamCaptureSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CGDisplayStreamCaptureSource.cpp; sourceTree = "<group>"; };
</span><del>-               416F807B24509F3300B68F02 /* CGWindowCaptureSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CGWindowCaptureSource.mm; sourceTree = "<group>"; };
</del><span class="cx">           416F807C24509F3300B68F02 /* CGDisplayStreamCaptureSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGDisplayStreamCaptureSource.h; sourceTree = "<group>"; };
</span><span class="cx">          416FD25D240EE1AE006661D8 /* NowPlayingInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NowPlayingInfo.h; sourceTree = "<group>"; };
</span><span class="cx">          4170A2E91D8C0CC000318452 /* JSDOMWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWrapper.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -17674,8 +17672,6 @@
</span><span class="cx">                          416F807C24509F3300B68F02 /* CGDisplayStreamCaptureSource.h */,
</span><span class="cx">                          0717765E26C303B700A63299 /* CGDisplayStreamScreenCaptureSource.h */,
</span><span class="cx">                          0717765F26C303B700A63299 /* CGDisplayStreamScreenCaptureSource.mm */,
</span><del>-                               416F807924509F3200B68F02 /* CGWindowCaptureSource.h */,
-                               416F807B24509F3300B68F02 /* CGWindowCaptureSource.mm */,
</del><span class="cx">                           3F8020311E9E381D00DEC61D /* CoreAudioCaptureDevice.cpp */,
</span><span class="cx">                          3F8020321E9E381D00DEC61D /* CoreAudioCaptureDevice.h */,
</span><span class="cx">                          3F8020331E9E381D00DEC61D /* CoreAudioCaptureDeviceManager.cpp */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacCGWindowCaptureSourceh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/mediastream/mac/CGWindowCaptureSource.h (282819 => 282820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/CGWindowCaptureSource.h    2021-09-21 15:38:30 UTC (rev 282819)
+++ trunk/Source/WebCore/platform/mediastream/mac/CGWindowCaptureSource.h       2021-09-21 15:55:59 UTC (rev 282820)
</span><span class="lines">@@ -1,74 +0,0 @@
</span><del>-/*
- * Copyright (C) 2018-2021 Apple Inc. All rights reserved.
- *
- * 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. ``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
- * 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
-
-#if ENABLE(MEDIA_STREAM) && PLATFORM(MAC)
-
-#include "DisplayCaptureSourceMac.h"
-
-typedef struct __CVBuffer *CVBufferRef;
-typedef CVBufferRef CVImageBufferRef;
-typedef CVImageBufferRef CVPixelBufferRef;
-typedef struct __CVPixelBufferPool *CVPixelBufferPoolRef;
-
-namespace WebCore {
-
-class PixelBufferConformerCV;
-
-class CGWindowCaptureSource final : public DisplayCaptureSourceMac::Capturer {
-public:
-    static Expected<UniqueRef<DisplayCaptureSourceMac::Capturer>, String> create(const String&);
-
-    explicit CGWindowCaptureSource(uint32_t);
-    virtual ~CGWindowCaptureSource() = default;
-
-    static std::optional<CaptureDevice> windowCaptureDeviceWithPersistentID(const String&);
-    static void windowCaptureDevices(Vector<CaptureDevice>&);
-
-private:
-    // DisplayCaptureSourceMac::Capturer
-    bool start() final { return true; }
-    void stop() final { }
-    DisplayCaptureSourceMac::DisplayFrameType generateFrame() final;
-    RealtimeMediaSourceSettings::DisplaySurfaceType surfaceType() const final { return RealtimeMediaSourceSettings::DisplaySurfaceType::Window; }
-    CaptureDevice::DeviceType deviceType() const final { return CaptureDevice::DeviceType::Window; }
-    void commitConfiguration(const RealtimeMediaSourceSettings&) final { }
-    IntSize intrinsicSize() const final;
-    const char* logClassName() const final { return "CGWindowCaptureSource"; }
-
-    RetainPtr<CGImageRef> windowImage();
-
-    IntSize m_windowSize;
-    CGWindowID m_windowID { 0 };
-    RetainPtr<CVPixelBufferPoolRef> m_bufferPool;
-    std::unique_ptr<PixelBufferConformerCV> m_pixelBufferConformer;
-    RetainPtr<CGImageRef> m_lastImage;
-    RetainPtr<CVPixelBufferRef> m_lastPixelBuffer;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM) && PLATFORM(MAC)
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacCGWindowCaptureSourcemm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/mediastream/mac/CGWindowCaptureSource.mm (282819 => 282820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/CGWindowCaptureSource.mm   2021-09-21 15:38:30 UTC (rev 282819)
+++ trunk/Source/WebCore/platform/mediastream/mac/CGWindowCaptureSource.mm      2021-09-21 15:55:59 UTC (rev 282820)
</span><span class="lines">@@ -1,198 +0,0 @@
</span><del>-/*
- * Copyright (C) 2018-2021 Apple Inc. All rights reserved.
- *
- * 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. ``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
- * 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.
- */
-
-#import "config.h"
-#import "CGWindowCaptureSource.h"
-
-#if ENABLE(MEDIA_STREAM) && PLATFORM(MAC)
-
-#import "GraphicsContextCG.h"
-#import "ImageBuffer.h"
-#import "Logging.h"
-#import "MediaConstraints.h"
-#import "MediaSampleAVFObjC.h"
-#import "NotImplemented.h"
-#import "PixelBufferConformerCV.h"
-#import "PlatformLayer.h"
-#import "RealtimeMediaSourceSettings.h"
-#import <pal/spi/cg/CoreGraphicsSPI.h>
-#import <wtf/cf/TypeCastsCF.h>
-#import <wtf/text/StringToIntegerConversion.h>
-
-#import <pal/cf/CoreMediaSoftLink.h>
-#import "CoreVideoSoftLink.h"
-
-WTF_DECLARE_CF_TYPE_TRAIT(CGImage);
-
-namespace WebCore {
-
-static bool anyOfCGWindow(const Function<bool(CFDictionaryRef info, unsigned id, const String& title)>& predicate)
-{
-    auto windows = adoptCF(CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID));
-    if (!windows) {
-        RELEASE_LOG(WebRTC, "CGWindowListCopyWindowInfo returned NULL");
-        return false;
-    }
-
-    auto windowCount = CFArrayGetCount(windows.get());
-    for (auto i = 0; i < windowCount; i++) {
-        auto windowInfo = checked_cf_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(windows.get(), i));
-        if (!windowInfo)
-            continue;
-
-        // Menus, the dock, etc have layers greater than 0, skip them.
-        auto windowLayerRef = checked_cf_cast<CFNumberRef>(CFDictionaryGetValue(windowInfo, kCGWindowLayer));
-        if (!windowLayerRef)
-            continue;
-        unsigned windowLayer;
-        CFNumberGetValue(windowLayerRef, kCFNumberIntType, &windowLayer);
-        if (windowLayer)
-            continue;
-
-        if (CFDictionaryGetValue(windowInfo, kCGWindowIsOnscreen) == kCFBooleanFalse)
-            continue;
-
-        auto windowIDRef = checked_cf_cast<CFNumberRef>(CFDictionaryGetValue(windowInfo, kCGWindowNumber));
-        if (!windowIDRef)
-            continue;
-        unsigned windowID;
-        CFNumberGetValue(windowIDRef, kCFNumberIntType, &windowID);
-        if (!windowID)
-            continue;
-
-        auto windowTitle = checked_cf_cast<CFStringRef>(CFDictionaryGetValue(windowInfo, kCGWindowName));
-
-        if (predicate(windowInfo, windowID, windowTitle))
-            return true;
-    }
-
-    return false;
-}
-
-static RetainPtr<CFDictionaryRef> windowDescription(CGWindowID id)
-{
-    auto ids = adoptCF(CFArrayCreate(nullptr, reinterpret_cast<const void**>(&id), 1, nullptr));
-    auto windows = adoptCF(CGWindowListCreateDescriptionFromArray(ids.get()));
-    if (!windows)
-        return nullptr;
-
-    return checked_cf_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(windows.get(), 0));
-}
-
-Expected<UniqueRef<DisplayCaptureSourceMac::Capturer>, String> CGWindowCaptureSource::create(const String& deviceID)
-{
-    auto windowID = parseInteger<uint32_t>(deviceID);
-    if (!windowID)
-        return makeUnexpected("Invalid window device ID"_s);
-
-    auto windowInfo = windowDescription(*windowID);
-    if (!windowInfo)
-        return makeUnexpected("Invalid window ID"_s);
-
-    return UniqueRef<DisplayCaptureSourceMac::Capturer>(makeUniqueRef<CGWindowCaptureSource>(*windowID));
-}
-
-IntSize CGWindowCaptureSource::intrinsicSize() const
-{
-    auto windowInfo = windowDescription(m_windowID);
-    if (!windowInfo) {
-        RELEASE_LOG(WebRTC, "Invalid window ID?");
-        return { };
-    }
-
-    auto boundsDictionary = checked_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(windowInfo.get(), kCGWindowBounds));
-    if (!boundsDictionary) {
-        RELEASE_LOG(WebRTC, "Unable to get window bounds");
-        return { };
-    }
-
-    CGRect windowBounds;
-    if (!CGRectMakeWithDictionaryRepresentation(boundsDictionary, &windowBounds)) {
-        RELEASE_LOG(WebRTC, "Unable to decode window bounds");
-        return { };
-    }
-
-    return IntSize(windowBounds.size);
-}
-
-CGWindowCaptureSource::CGWindowCaptureSource(uint32_t windowID)
-    : m_windowID(windowID)
-{
-}
-
-RetainPtr<CGImageRef> CGWindowCaptureSource::windowImage()
-{
-    auto image = adoptCF(CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, m_windowID, kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque));
-    if (!image)
-        RELEASE_LOG(WebRTC, "CGWindowCaptureSource::windowImage: failed to capture window image");
-
-    return image;
-}
-
-DisplayCaptureSourceMac::DisplayFrameType CGWindowCaptureSource::generateFrame()
-{
-    return NativeImage::create(windowImage());
-}
-
-std::optional<CaptureDevice> CGWindowCaptureSource::windowCaptureDeviceWithPersistentID(const String& idString)
-{
-    auto windowID = parseInteger<uint32_t>(idString);
-    if (!windowID) {
-        RELEASE_LOG(WebRTC, "CGWindowCaptureSource::windowCaptureDeviceWithPersistentID: window ID does not convert to 32-bit integer");
-        return std::nullopt;
-    }
-
-    String windowTitle;
-    if (!anyOfCGWindow([&windowTitle, windowID] (CFDictionaryRef, CGWindowID id, const String& title) {
-        if (windowID != id)
-            return false;
-
-        windowTitle = title;
-        return true;
-
-    })) {
-        RELEASE_LOG(WebRTC, "CGWindowCaptureSource::windowCaptureDeviceWithPersistentID: window ID is not valid");
-        return std::nullopt;
-    }
-
-    auto device = CaptureDevice(String::number(*windowID), CaptureDevice::DeviceType::Window, windowTitle);
-    device.setEnabled(true);
-
-    return device;
-}
-
-void CGWindowCaptureSource::windowCaptureDevices(Vector<CaptureDevice>& windows)
-{
-    anyOfCGWindow([&] (CFDictionaryRef, int id, const String& title) mutable {
-        CaptureDevice device(String::number(id), CaptureDevice::DeviceType::Window, title);
-        device.setEnabled(true);
-        windows.append(WTFMove(device));
-        return false;
-    });
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM) && PLATFORM(MAC)
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacDisplayCaptureManagerCocoacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp (282819 => 282820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp     2021-09-21 15:38:30 UTC (rev 282819)
+++ trunk/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp        2021-09-21 15:55:59 UTC (rev 282820)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> #include "CGDisplayStreamScreenCaptureSource.h"
</span><del>-#include "CGWindowCaptureSource.h"
</del><span class="cx"> #include <CoreGraphics/CGDirectDisplay.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -67,9 +66,6 @@
</span><span class="cx"> 
</span><span class="cx"> void DisplayCaptureManagerCocoa::updateWindowCaptureDevices()
</span><span class="cx"> {
</span><del>-#if PLATFORM(MAC)
-    CGWindowCaptureSource::windowCaptureDevices(m_devices);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::optional<CaptureDevice> DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID(const String& deviceID)
</span><span class="lines">@@ -84,12 +80,8 @@
</span><span class="cx"> 
</span><span class="cx"> std::optional<CaptureDevice> DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID(const String& deviceID)
</span><span class="cx"> {
</span><del>-#if PLATFORM(MAC)
-    return CGWindowCaptureSource::windowCaptureDeviceWithPersistentID(deviceID);
-#else
</del><span class="cx">     UNUSED_PARAM(deviceID);
</span><span class="cx">     return std::nullopt;
</span><del>-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::optional<CaptureDevice> DisplayCaptureManagerCocoa::captureDeviceWithPersistentID(CaptureDevice::DeviceType type, const String& id)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacDisplayCaptureSourceMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceMac.cpp (282819 => 282820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceMac.cpp        2021-09-21 15:38:30 UTC (rev 282819)
+++ trunk/Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceMac.cpp   2021-09-21 15:55:59 UTC (rev 282820)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #if ENABLE(MEDIA_STREAM) && PLATFORM(MAC)
</span><span class="cx"> 
</span><span class="cx"> #include "CGDisplayStreamScreenCaptureSource.h"
</span><del>-#include "CGWindowCaptureSource.h"
</del><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MediaSampleAVFObjC.h"
</span><span class="cx"> #include "PixelBufferConformerCV.h"
</span><span class="lines">@@ -60,7 +59,6 @@
</span><span class="cx">     case CaptureDevice::DeviceType::Screen:
</span><span class="cx">         return create(CGDisplayStreamScreenCaptureSource::create(device.persistentId()), device, constraints);
</span><span class="cx">     case CaptureDevice::DeviceType::Window:
</span><del>-        return create(CGWindowCaptureSource::create(device.persistentId()), device, constraints);
</del><span class="cx">     case CaptureDevice::DeviceType::Microphone:
</span><span class="cx">     case CaptureDevice::DeviceType::Speaker:
</span><span class="cx">     case CaptureDevice::DeviceType::Camera:
</span></span></pre>
</div>
</div>

</body>
</html>