Skip to content

Commit

Permalink
v2: Fix warnings found by compiling with -Wformat in open source clan…
Browse files Browse the repository at this point in the history
…g-17

https://bugs.webkit.org/show_bug.cgi?id=269508
<rdar://123036201>

Reviewed by Timothy Hatcher and Chris Dumez.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::loadInspectorBackgroundPage):
(WebKit::WebExtensionContext::unloadInspectorBackgroundPage):
- Add enumToUnderlyingType() to fix the warnings.

Canonical link: https://commits.webkit.org/274768@main
  • Loading branch information
David Kilzer authored and ddkilzer committed Feb 15, 2024
1 parent f31b38a commit f7cc294
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -80,6 +80,7 @@
#import <WebCore/UserScript.h>
#import <pal/spi/cocoa/NSKeyedUnarchiverSPI.h>
#import <wtf/BlockPtr.h>
#import <wtf/EnumTraits.h>
#import <wtf/FileSystem.h>
#import <wtf/URLParser.h>
#import <wtf/cocoa/VectorCocoa.h>
Expand Down Expand Up @@ -3184,7 +3185,7 @@ void effectiveAppearanceDidChange(Inspector::ExtensionAppearance appearance) ove

inspector.extensionController()->registerExtension(uniqueIdentifier(), uniqueIdentifier(), extension().displayName(), [this, protectedThis = Ref { *this }, inspector = Ref { inspector }, tab = Ref { tab }](Expected<RefPtr<API::InspectorExtension>, Inspector::ExtensionError> result) {
if (!result) {
RELEASE_LOG_ERROR(Extensions, "Failed to register Inspector extension (error %{public}hhu)", result.error());
RELEASE_LOG_ERROR(Extensions, "Failed to register Inspector extension (error %{public}hhu)", enumToUnderlyingType(result.error()));
return;
}

Expand Down Expand Up @@ -3240,7 +3241,7 @@ void effectiveAppearanceDidChange(Inspector::ExtensionAppearance appearance) ove

inspector.extensionController()->unregisterExtension(uniqueIdentifier(), [](Expected<void, Inspector::ExtensionError> result) {
if (!result)
RELEASE_LOG_ERROR(Extensions, "Failed to unregister Inspector extension (error %{public}hhu)", result.error());
RELEASE_LOG_ERROR(Extensions, "Failed to unregister Inspector extension (error %{public}hhu)", enumToUnderlyingType(result.error()));
});
}

Expand Down

0 comments on commit f7cc294

Please sign in to comment.