Skip to content

Commit 03fdb81

Browse files
Add deprecation macros
https://bugs.webkit.org/show_bug.cgi?id=224624 Source/ThirdParty/ANGLE: * src/gpu_info_util/SystemInfo_macos.mm: (angle::GetVendorIDFromMetalDeviceRegistryID): Source/WebCore: * platform/audio/mac/AudioHardwareListenerMac.cpp: (WebCore::isAudioHardwareProcessRunning): (WebCore::currentDeviceSupportedBufferSizes): (WebCore::processIsRunningPropertyDescriptor): (WebCore::outputDevicePropertyDescriptor): * platform/audio/mac/AudioSessionMac.mm: (WebCore::defaultDevice): (WebCore::defaultDeviceTransportIsBluetooth): (WebCore::AudioSessionPrivate::addSampleRateObserverIfNeeded): (WebCore::AudioSessionPrivate::addBufferSizeObserverIfNeeded): (WebCore::AudioSession::sampleRate const): (WebCore::AudioSession::bufferSize const): (WebCore::AudioSession::maximumNumberOfOutputChannels const): (WebCore::AudioSession::setPreferredBufferSize): (WebCore::AudioSession::isMuted const): (WebCore::AudioSession::addMutedStateObserver): (WebCore::AudioSession::removeMutedStateObserver): * platform/graphics/mac/GraphicsChecksMac.cpp: (WebCore::attachToAppleGraphicsControl): * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: (WebCore::getDeviceInfo): (WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice): (WebCore::CoreAudioCaptureDevice::relatedAudioDeviceIDs): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::deviceHasInputStreams): (WebCore::deviceHasOutputStreams): (WebCore::isValidCaptureDevice): (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): (WebCore::computeAudioDeviceList): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioSharedUnit::defaultOutputDevice): Canonical link: https://commits.webkit.org/236589@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent a9f2e7c commit 03fdb81

9 files changed

Lines changed: 238 additions & 25 deletions

File tree

Source/ThirdParty/ANGLE/ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2021-04-15 Alex Christensen <achristensen@webkit.org>
2+
3+
Add deprecation macros
4+
https://bugs.webkit.org/show_bug.cgi?id=224624
5+
6+
* src/gpu_info_util/SystemInfo_macos.mm:
7+
(angle::GetVendorIDFromMetalDeviceRegistryID):
8+
19
2021-04-12 Dean Jackson <dino@apple.com>
210

311
REGRESSION (Metal ANGLE): [Catalina] 6 consistent WebGL failures / timeouts

Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_macos.mm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@
2828

2929
std::string GetMachineModel()
3030
{
31+
#pragma clang diagnostic push
32+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
3133
io_service_t platformExpert = IOServiceGetMatchingService(
3234
kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
35+
#pragma clang diagnostic pop
3336

3437
if (platformExpert == IO_OBJECT_NULL)
3538
{
@@ -91,11 +94,14 @@ void GetIORegistryDevices(std::vector<GPUDeviceInfo> *devices)
9194
CFMutableDictionaryRef matchDictionary = IOServiceMatching(kServiceNames[i]);
9295

9396
io_iterator_t entryIterator;
97+
#pragma clang diagnostic push
98+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
9499
if (IOServiceGetMatchingServices(kIOMasterPortDefault, matchDictionary, &entryIterator) !=
95100
kIOReturnSuccess)
96101
{
97102
continue;
98103
}
104+
#pragma clang diagnostic pop
99105

100106
io_registry_entry_t entry = IO_OBJECT_NULL;
101107
while ((entry = IOIteratorNext(entryIterator)) != IO_OBJECT_NULL)
@@ -150,7 +156,10 @@ void SetActiveGPUIndex(SystemInfo *info)
150156
return;
151157

152158
CFMutableDictionaryRef matchDictionary = IORegistryEntryIDMatching(gpuID);
159+
#pragma clang diagnostic push
160+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
153161
io_service_t gpuEntry = IOServiceGetMatchingService(kIOMasterPortDefault, matchDictionary);
162+
#pragma clang diagnostic pop
154163

155164
if (gpuEntry == IO_OBJECT_NULL)
156165
{
@@ -251,8 +260,11 @@ VendorID GetVendorIDFromMetalDeviceRegistryID(uint64_t registryID)
251260

252261
// IOServiceGetMatchingService will consume the reference on the matching dictionary,
253262
// so we don't need to release the dictionary.
263+
#pragma clang diagnostic push
264+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
254265
io_registry_entry_t acceleratorEntry =
255266
IOServiceGetMatchingService(kIOMasterPortDefault, matchingDict);
267+
#pragma clang diagnostic pop
256268
if (acceleratorEntry == IO_OBJECT_NULL)
257269
{
258270
return 0;

Source/WebCore/ChangeLog

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
2021-04-15 Alex Christensen <achristensen@webkit.org>
2+
3+
Add deprecation macros
4+
https://bugs.webkit.org/show_bug.cgi?id=224624
5+
6+
* platform/audio/mac/AudioHardwareListenerMac.cpp:
7+
(WebCore::isAudioHardwareProcessRunning):
8+
(WebCore::currentDeviceSupportedBufferSizes):
9+
(WebCore::processIsRunningPropertyDescriptor):
10+
(WebCore::outputDevicePropertyDescriptor):
11+
* platform/audio/mac/AudioSessionMac.mm:
12+
(WebCore::defaultDevice):
13+
(WebCore::defaultDeviceTransportIsBluetooth):
14+
(WebCore::AudioSessionPrivate::addSampleRateObserverIfNeeded):
15+
(WebCore::AudioSessionPrivate::addBufferSizeObserverIfNeeded):
16+
(WebCore::AudioSession::sampleRate const):
17+
(WebCore::AudioSession::bufferSize const):
18+
(WebCore::AudioSession::maximumNumberOfOutputChannels const):
19+
(WebCore::AudioSession::setPreferredBufferSize):
20+
(WebCore::AudioSession::isMuted const):
21+
(WebCore::AudioSession::addMutedStateObserver):
22+
(WebCore::AudioSession::removeMutedStateObserver):
23+
* platform/graphics/mac/GraphicsChecksMac.cpp:
24+
(WebCore::attachToAppleGraphicsControl):
25+
* platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
26+
(WebCore::getDeviceInfo):
27+
(WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice):
28+
(WebCore::CoreAudioCaptureDevice::relatedAudioDeviceIDs):
29+
* platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
30+
(WebCore::deviceHasInputStreams):
31+
(WebCore::deviceHasOutputStreams):
32+
(WebCore::isValidCaptureDevice):
33+
(WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
34+
(WebCore::computeAudioDeviceList):
35+
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
36+
(WebCore::CoreAudioSharedUnit::defaultOutputDevice):
37+
138
2021-04-15 Don Olmstead <don.olmstead@sony.com>
239

340
ANGLE is only being built when WebGL is enabled

Source/WebCore/platform/audio/mac/AudioHardwareListenerMac.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ static AudioHardwareActivityType isAudioHardwareProcessRunning()
4141
AudioObjectPropertyAddress propertyAddress = {
4242
kAudioHardwarePropertyProcessIsRunning,
4343
kAudioObjectPropertyScopeGlobal,
44+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
4445
kAudioObjectPropertyElementMaster
46+
ALLOW_DEPRECATED_DECLARATIONS_END
4547
};
4648

4749
if (!AudioObjectHasProperty(kAudioObjectSystemObject, &propertyAddress))
@@ -66,7 +68,10 @@ static AudioHardwareListener::BufferSizeRange currentDeviceSupportedBufferSizes(
6668
AudioObjectPropertyAddress defaultOutputDeviceDescriptor = {
6769
kAudioHardwarePropertyDefaultOutputDevice,
6870
kAudioObjectPropertyScopeGlobal,
69-
kAudioObjectPropertyElementMaster };
71+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
72+
kAudioObjectPropertyElementMaster
73+
ALLOW_DEPRECATED_DECLARATIONS_END
74+
};
7075

7176
if (AudioObjectGetPropertyData(kAudioObjectSystemObject, &defaultOutputDeviceDescriptor, 0, 0, &descriptorSize, (void*)&deviceID))
7277
return { };
@@ -77,7 +82,9 @@ static AudioHardwareListener::BufferSizeRange currentDeviceSupportedBufferSizes(
7782
AudioObjectPropertyAddress bufferSizeDescriptor = {
7883
kAudioDevicePropertyBufferFrameSizeRange,
7984
kAudioObjectPropertyScopeGlobal,
85+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
8086
kAudioObjectPropertyElementMaster,
87+
ALLOW_DEPRECATED_DECLARATIONS_END
8188
};
8289

8390
if (AudioObjectGetPropertyData(deviceID, &bufferSizeDescriptor, 0, 0, &descriptorSize, &bufferSizes))
@@ -92,7 +99,9 @@ static const AudioObjectPropertyAddress& processIsRunningPropertyDescriptor()
9299
static const AudioObjectPropertyAddress processIsRunningProperty = {
93100
kAudioHardwarePropertyProcessIsRunning,
94101
kAudioObjectPropertyScopeGlobal,
102+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
95103
kAudioObjectPropertyElementMaster
104+
ALLOW_DEPRECATED_DECLARATIONS_END
96105
};
97106

98107
return processIsRunningProperty;
@@ -103,7 +112,9 @@ static const AudioObjectPropertyAddress& outputDevicePropertyDescriptor()
103112
static const AudioObjectPropertyAddress outputDeviceProperty = {
104113
kAudioHardwarePropertyDefaultOutputDevice,
105114
kAudioObjectPropertyScopeGlobal,
115+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
106116
kAudioObjectPropertyElementMaster
117+
ALLOW_DEPRECATED_DECLARATIONS_END
107118
};
108119

109120
return outputDeviceProperty;

Source/WebCore/platform/audio/mac/AudioSessionMac.mm

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ static AudioDeviceID defaultDevice()
4848
AudioObjectPropertyAddress defaultOutputDeviceAddress = {
4949
kAudioHardwarePropertyDefaultOutputDevice,
5050
kAudioObjectPropertyScopeGlobal,
51-
kAudioObjectPropertyElementMaster };
51+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
52+
kAudioObjectPropertyElementMaster
53+
ALLOW_DEPRECATED_DECLARATIONS_END
54+
};
5255
OSStatus result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &defaultOutputDeviceAddress, 0, 0, &infoSize, (void*)&deviceID);
5356
if (result)
5457
return 0; // error
@@ -66,7 +69,9 @@ static float defaultDeviceTransportIsBluetooth()
6669
static const AudioObjectPropertyAddress audioDeviceTransportTypeProperty = {
6770
kAudioDevicePropertyTransportType,
6871
kAudioObjectPropertyScopeGlobal,
72+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
6973
kAudioObjectPropertyElementMaster,
74+
ALLOW_DEPRECATED_DECLARATIONS_END
7075
};
7176
UInt32 transportType = kAudioDeviceTransportTypeUnknown;
7277
UInt32 transportSize = sizeof(transportType);
@@ -109,7 +114,13 @@ static float defaultDeviceTransportIsBluetooth()
109114
return;
110115
hasSampleRateObserver = true;
111116

112-
AudioObjectPropertyAddress nominalSampleRateAddress = { kAudioDevicePropertyNominalSampleRate, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
117+
AudioObjectPropertyAddress nominalSampleRateAddress = {
118+
kAudioDevicePropertyNominalSampleRate,
119+
kAudioObjectPropertyScopeGlobal,
120+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
121+
kAudioObjectPropertyElementMaster
122+
ALLOW_DEPRECATED_DECLARATIONS_END
123+
};
113124
AudioObjectAddPropertyListener(defaultDevice(), &nominalSampleRateAddress, handleSampleRateChange, this);
114125
}
115126

@@ -136,7 +147,13 @@ static float defaultDeviceTransportIsBluetooth()
136147
if (hasBufferSizeObserver)
137148
return;
138149

139-
AudioObjectPropertyAddress bufferSizeAddress = { kAudioDevicePropertyBufferFrameSize, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
150+
AudioObjectPropertyAddress bufferSizeAddress = {
151+
kAudioDevicePropertyBufferFrameSize,
152+
kAudioObjectPropertyScopeGlobal,
153+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
154+
kAudioObjectPropertyElementMaster
155+
ALLOW_DEPRECATED_DECLARATIONS_END
156+
};
140157
AudioObjectAddPropertyListener(defaultDevice(), &bufferSizeAddress, handleBufferSizeChange, this);
141158
}
142159

@@ -262,7 +279,9 @@ static float defaultDeviceTransportIsBluetooth()
262279
AudioObjectPropertyAddress nominalSampleRateAddress = {
263280
kAudioDevicePropertyNominalSampleRate,
264281
kAudioObjectPropertyScopeGlobal,
282+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
265283
kAudioObjectPropertyElementMaster
284+
ALLOW_DEPRECATED_DECLARATIONS_END
266285
};
267286
OSStatus result = AudioObjectGetPropertyData(defaultDevice(), &nominalSampleRateAddress, 0, 0, &nominalSampleRateSize, (void*)&nominalSampleRate);
268287
if (result != noErr) {
@@ -292,7 +311,10 @@ static float defaultDeviceTransportIsBluetooth()
292311
AudioObjectPropertyAddress bufferSizeAddress = {
293312
kAudioDevicePropertyBufferFrameSize,
294313
kAudioObjectPropertyScopeGlobal,
295-
kAudioObjectPropertyElementMaster };
314+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
315+
kAudioObjectPropertyElementMaster
316+
ALLOW_DEPRECATED_DECLARATIONS_END
317+
};
296318
OSStatus result = AudioObjectGetPropertyData(defaultDevice(), &bufferSizeAddress, 0, 0, &bufferSizeSize, &bufferSize);
297319

298320
if (result)
@@ -314,7 +336,9 @@ static float defaultDeviceTransportIsBluetooth()
314336
AudioObjectPropertyAddress sizeAddress = {
315337
kAudioDevicePropertyStreamConfiguration,
316338
kAudioObjectPropertyScopeOutput,
339+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
317340
kAudioObjectPropertyElementMaster
341+
ALLOW_DEPRECATED_DECLARATIONS_END
318342
};
319343

320344
UInt32 size = 0;
@@ -366,7 +390,9 @@ static float defaultDeviceTransportIsBluetooth()
366390
AudioObjectPropertyAddress bufferSizeRangeAddress = {
367391
kAudioDevicePropertyBufferFrameSizeRange,
368392
kAudioObjectPropertyScopeGlobal,
393+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
369394
kAudioObjectPropertyElementMaster
395+
ALLOW_DEPRECATED_DECLARATIONS_END
370396
};
371397
OSStatus result = AudioObjectGetPropertyData(defaultDevice(), &bufferSizeRangeAddress, 0, 0, &bufferSizeRangeSize, &bufferSizeRange);
372398
if (result)
@@ -379,7 +405,10 @@ static float defaultDeviceTransportIsBluetooth()
379405
AudioObjectPropertyAddress preferredBufferSizeAddress = {
380406
kAudioDevicePropertyBufferFrameSize,
381407
kAudioObjectPropertyScopeGlobal,
382-
kAudioObjectPropertyElementMaster };
408+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
409+
kAudioObjectPropertyElementMaster
410+
ALLOW_DEPRECATED_DECLARATIONS_END
411+
};
383412

384413
result = AudioObjectSetPropertyData(defaultDevice(), &preferredBufferSizeAddress, 0, 0, sizeof(bufferSizeOut), (void*)&bufferSizeOut);
385414

@@ -398,7 +427,13 @@ static float defaultDeviceTransportIsBluetooth()
398427
{
399428
UInt32 mute = 0;
400429
UInt32 muteSize = sizeof(mute);
401-
AudioObjectPropertyAddress muteAddress = { kAudioDevicePropertyMute, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster };
430+
AudioObjectPropertyAddress muteAddress = {
431+
kAudioDevicePropertyMute,
432+
kAudioDevicePropertyScopeOutput,
433+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
434+
kAudioObjectPropertyElementMaster
435+
ALLOW_DEPRECATED_DECLARATIONS_END
436+
};
402437
AudioObjectGetPropertyData(defaultDevice(), &muteAddress, 0, nullptr, &muteSize, &mute);
403438

404439
switch (mute) {
@@ -442,14 +477,26 @@ static OSStatus handleMutePropertyChange(AudioObjectID, UInt32, const AudioObjec
442477
if (m_observers.size() > 1)
443478
return;
444479

445-
AudioObjectPropertyAddress muteAddress = { kAudioDevicePropertyMute, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster };
480+
AudioObjectPropertyAddress muteAddress = {
481+
kAudioDevicePropertyMute,
482+
kAudioDevicePropertyScopeOutput,
483+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
484+
kAudioObjectPropertyElementMaster
485+
ALLOW_DEPRECATED_DECLARATIONS_END
486+
};
446487
AudioObjectAddPropertyListener(defaultDevice(), &muteAddress, handleMutePropertyChange, this);
447488
}
448489

449490
void AudioSession::removeMutedStateObserver(MutedStateObserver* observer)
450491
{
451492
if (m_observers.size() == 1) {
452-
AudioObjectPropertyAddress muteAddress = { kAudioDevicePropertyMute, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster };
493+
AudioObjectPropertyAddress muteAddress = {
494+
kAudioDevicePropertyMute,
495+
kAudioDevicePropertyScopeOutput,
496+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
497+
kAudioObjectPropertyElementMaster
498+
ALLOW_DEPRECATED_DECLARATIONS_END
499+
};
453500
AudioObjectRemovePropertyListener(defaultDevice(), &muteAddress, handleMutePropertyChange, this);
454501
}
455502

Source/WebCore/platform/graphics/mac/GraphicsChecksMac.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ static io_connect_t attachToAppleGraphicsControl()
4545
{
4646
mach_port_t masterPort = MACH_PORT_NULL;
4747

48+
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
4849
if (IOMasterPort(MACH_PORT_NULL, &masterPort) != KERN_SUCCESS)
4950
return IO_OBJECT_NULL;
51+
ALLOW_DEPRECATED_DECLARATIONS_END
5052

5153
CFDictionaryRef classToMatch = IOServiceMatching("AppleGraphicsControl");
5254
if (!classToMatch)

0 commit comments

Comments
 (0)