Skip to content

Commit 6437c2e

Browse files
committed
Refactor macros for low power mode code
https://bugs.webkit.org/show_bug.cgi?id=219497 Reviewed by Geoffrey Garen. Source/WebCore: Use HAVE(APPLE_LOW_POWER_MODE_SUPPORT) instead of PLATFORM(IOS_FAMILY), which is equivalent. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/LowPowerModeNotifier.h: * platform/cocoa/LowPowerModeNotifier.mm: Renamed from Source/WebCore/platform/ios/LowPowerModeNotifierIOS.mm. (-[WebLowPowerModeObserver initWithNotifier:]): (-[WebLowPowerModeObserver dealloc]): (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]): (WebCore::LowPowerModeNotifier::LowPowerModeNotifier): (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier): (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled const): (WebCore::LowPowerModeNotifier::notifyLowPowerModeChanged): (WebCore::notifyLowPowerModeChanged): Source/WTF: Add new HAVE_APPLE_LOW_POWER_MODE_SUPPORT macro, enabled on iOS_FAMILY. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/232090@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 17acb72 commit 6437c2e

10 files changed

Lines changed: 47 additions & 10 deletions

File tree

Source/WTF/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2020-12-03 Chris Dumez <cdumez@apple.com>
2+
3+
Refactor macros for low power mode code
4+
https://bugs.webkit.org/show_bug.cgi?id=219497
5+
6+
Reviewed by Geoffrey Garen.
7+
8+
Add new HAVE_APPLE_LOW_POWER_MODE_SUPPORT macro, enabled on iOS_FAMILY.
9+
10+
* wtf/PlatformHave.h:
11+
112
2020-12-03 Fujii Hironori <Hironori.Fujii@sony.com>
213

314
Remove GraphicsContextGLOpenGL::setRenderbufferStorageFromDrawable declaration

Source/WTF/wtf/PlatformHave.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,3 +777,7 @@
777777
#if (PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
778778
#define HAVE_COREVIDEO_COMPRESSED_PIXEL_FORMAT_TYPES 1
779779
#endif
780+
781+
#if PLATFORM(IOS_FAMILY)
782+
#define HAVE_APPLE_LOW_POWER_MODE_SUPPORT 1
783+
#endif

Source/WebCore/ChangeLog

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
2020-12-03 Chris Dumez <cdumez@apple.com>
2+
3+
Refactor macros for low power mode code
4+
https://bugs.webkit.org/show_bug.cgi?id=219497
5+
6+
Reviewed by Geoffrey Garen.
7+
8+
Use HAVE(APPLE_LOW_POWER_MODE_SUPPORT) instead of PLATFORM(IOS_FAMILY), which is equivalent.
9+
10+
* SourcesCocoa.txt:
11+
* WebCore.xcodeproj/project.pbxproj:
12+
* platform/LowPowerModeNotifier.h:
13+
* platform/cocoa/LowPowerModeNotifier.mm: Renamed from Source/WebCore/platform/ios/LowPowerModeNotifierIOS.mm.
14+
(-[WebLowPowerModeObserver initWithNotifier:]):
15+
(-[WebLowPowerModeObserver dealloc]):
16+
(-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
17+
(WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
18+
(WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
19+
(WebCore::LowPowerModeNotifier::isLowPowerModeEnabled const):
20+
(WebCore::LowPowerModeNotifier::notifyLowPowerModeChanged):
21+
(WebCore::notifyLowPowerModeChanged):
22+
123
2020-12-03 Alicia Boya García <aboya@igalia.com>
224

325
[GStreamer] Fix video losing size at the end of the stream

Source/WebCore/SourcesCocoa.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ platform/cocoa/DragImageCocoa.mm
237237
platform/cocoa/FileMonitorCocoa.mm
238238
platform/cocoa/KeyEventCocoa.mm
239239
platform/cocoa/LocalizedStringsCocoa.mm
240+
platform/cocoa/LowPowerModeNotifier.mm
240241
platform/cocoa/MIMETypeRegistryCocoa.mm
241242
platform/cocoa/MediaUtilities.cpp
242243
platform/cocoa/NetworkExtensionContentFilter.mm
@@ -436,7 +437,6 @@ platform/ios/LegacyTileLayerPool.mm
436437
platform/ios/LocalCurrentGraphicsContextIOS.mm
437438
platform/ios/LocalCurrentTraitCollection.mm
438439
platform/ios/LocalizedDeviceModel.mm
439-
platform/ios/LowPowerModeNotifierIOS.mm
440440
platform/ios/PasteboardIOS.mm
441441
platform/ios/PlatformEventFactoryIOS.mm @no-unify
442442
platform/ios/PlatformPasteboardIOS.mm

Source/WebCore/WebCore.xcodeproj/project.pbxproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7801,7 +7801,6 @@
78017801
419E6EC72566D214002B5010 /* RTCPeerConnectionIceErrorEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionIceErrorEvent.h; sourceTree = "<group>"; };
78027802
419E6ED22567BF69002B5010 /* RTCRtpScriptTransformerContext.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCRtpScriptTransformerContext.idl; sourceTree = "<group>"; };
78037803
419E6ED52567BF6A002B5010 /* RTCRtpScriptTransformerContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCRtpScriptTransformerContext.h; sourceTree = "<group>"; };
7804-
419E6ED82567D8D9002B5010 /* LibWebRTCRtpTransformableFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibWebRTCRtpTransformableFrame.cpp; path = libwebrtc/LibWebRTCRtpTransformableFrame.cpp; sourceTree = "<group>"; };
78057804
419FAFAD1ABABCD5005B3572 /* ReadableStreamBYOBReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamBYOBReader.idl; sourceTree = "<group>"; };
78067805
419FAFAD1ABABCD5005B828B /* ReadableStreamDefaultReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamDefaultReader.idl; sourceTree = "<group>"; };
78077806
41A023ED1A39DB7900F722CF /* ReadableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStream.idl; sourceTree = "<group>"; };
@@ -8178,7 +8177,7 @@
81788177
46EF14261F97B7BA00C2A524 /* ServiceWorkerWindowClient.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceWorkerWindowClient.idl; sourceTree = "<group>"; };
81798178
46EF14271F97B7BA00C2A524 /* ServiceWorkerClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerClient.cpp; sourceTree = "<group>"; };
81808179
46EF14281F97B7BA00C2A524 /* ServiceWorkerClient.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceWorkerClient.idl; sourceTree = "<group>"; };
8181-
46EFAF0D1E5FB9C200E7F34B /* LowPowerModeNotifierIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LowPowerModeNotifierIOS.mm; sourceTree = "<group>"; };
8180+
46EFAF0D1E5FB9C200E7F34B /* LowPowerModeNotifier.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LowPowerModeNotifier.mm; sourceTree = "<group>"; };
81828181
46EFAF0F1E5FB9E100E7F34B /* LowPowerModeNotifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowPowerModeNotifier.cpp; sourceTree = "<group>"; };
81838182
46EFAF101E5FB9E100E7F34B /* LowPowerModeNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LowPowerModeNotifier.h; sourceTree = "<group>"; };
81848183
46F91BC91FCDD0FE001599C3 /* JSWorkerNavigatorCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerNavigatorCustom.cpp; sourceTree = "<group>"; };
@@ -24308,7 +24307,6 @@
2430824307
1C43DE6A22AB4B8A001527D9 /* LocalCurrentTraitCollection.mm */,
2430924308
E35B907C23F60677000011FF /* LocalizedDeviceModel.h */,
2431024309
E35B907E23F60677000011FF /* LocalizedDeviceModel.mm */,
24311-
46EFAF0D1E5FB9C200E7F34B /* LowPowerModeNotifierIOS.mm */,
2431224310
E39628C02395743000658ECD /* MotionManagerClient.h */,
2431324311
E45390190EAFCACA003695C8 /* PasteboardIOS.mm */,
2431424312
26601EBD14B3B9AD0012C0FE /* PlatformEventFactoryIOS.h */,
@@ -24467,6 +24465,7 @@
2446724465
A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */,
2446824466
06E81ED60AB5D5E900C87837 /* LocalCurrentGraphicsContext.h */,
2446924467
1A4832B21A953BA6008B4DFE /* LocalizedStringsCocoa.mm */,
24468+
46EFAF0D1E5FB9C200E7F34B /* LowPowerModeNotifier.mm */,
2447024469
939C0D282564E7F200B3211B /* MediaUtilities.cpp */,
2447124470
939C0D292564E7F200B3211B /* MediaUtilities.h */,
2447224471
C53D39331C97892D007F3AE9 /* MIMETypeRegistryCocoa.mm */,

Source/WebCore/platform/LowPowerModeNotifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
namespace WebCore {
3030

31-
#if !PLATFORM(IOS_FAMILY) && !USE(GLIB)
31+
#if !HAVE(APPLE_LOW_POWER_MODE_SUPPORT) && !USE(GLIB)
3232

3333
LowPowerModeNotifier::LowPowerModeNotifier(LowPowerModeChangeCallback&&)
3434
{

Source/WebCore/platform/LowPowerModeNotifier.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include <wtf/Function.h>
2929

30-
#if PLATFORM(IOS_FAMILY)
30+
#if HAVE(APPLE_LOW_POWER_MODE_SUPPORT)
3131
#include <wtf/RetainPtr.h>
3232
OBJC_CLASS WebLowPowerModeObserver;
3333
#endif
@@ -49,7 +49,7 @@ class LowPowerModeNotifier {
4949
WEBCORE_EXPORT bool isLowPowerModeEnabled() const;
5050

5151
private:
52-
#if PLATFORM(IOS_FAMILY)
52+
#if HAVE(APPLE_LOW_POWER_MODE_SUPPORT)
5353
void notifyLowPowerModeChanged(bool);
5454
friend void notifyLowPowerModeChanged(LowPowerModeNotifier&, bool);
5555

Source/WebCore/platform/ios/LowPowerModeNotifierIOS.mm renamed to Source/WebCore/platform/cocoa/LowPowerModeNotifier.mm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525

2626
#import "config.h"
2727

28-
#if PLATFORM(IOS_FAMILY)
29-
28+
#if HAVE(APPLE_LOW_POWER_MODE_SUPPORT)
3029
#import "LowPowerModeNotifier.h"
3130

3231
#import "Logging.h"
@@ -102,4 +101,4 @@ void notifyLowPowerModeChanged(LowPowerModeNotifier& notifier, bool enabled)
102101

103102
} // namespace WebCore
104103

105-
#endif // PLATFORM(IOS_FAMILY)
104+
#endif // PLATFORM(APPLE_LOW_POWER_MODE_SUPPORT)

Source/WebCore/platform/gamepad/mac/MultiGamepadProvider.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include "GamepadProvider.h"
3131
#include "GamepadProviderClient.h"
32+
#include "PlatformGamepad.h"
3233
#include <wtf/Forward.h>
3334
#include <wtf/HashSet.h>
3435

Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#import "FloatConversion.h"
3737
#import "GraphicsContextCG.h"
3838
#import "ImageBuffer.h"
39+
#import "Logging.h"
3940
#import "PlatformImageBuffer.h"
4041
#import "SourceGraphic.h"
4142
#import <CoreImage/CIContext.h>

0 commit comments

Comments
 (0)