[webkit-changes] [WebKit/WebKit] 71338e: Clean up Web Extension logging and add some more l...
Timothy Hatcher
noreply at github.com
Mon Aug 21 17:07:30 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 71338e8db0ce777a17016df4b4367a61f9261449
https://github.com/WebKit/WebKit/commit/71338e8db0ce777a17016df4b4367a61f9261449
Author: Timothy Hatcher <timothy at apple.com>
Date: 2023-08-21 (Mon, 21 Aug 2023)
Changed paths:
M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtension.mm
M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionContext.mm
M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionController.mm
M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionControllerConfiguration.mm
M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionMatchPattern.mm
M Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPITestCocoa.mm
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerCocoa.mm
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerConfiguration.mm
M Source/WebKit/UIProcess/Extensions/WebExtensionAlarm.cpp
M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h
M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIAlarmsCocoa.mm
M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIPermissionsCocoa.mm
M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIRuntimeCocoa.mm
M Source/WebKit/WebProcess/Extensions/Bindings/Cocoa/JSWebExtensionWrapperCocoa.mm
M Source/WebKit/WebProcess/Extensions/Bindings/Scripts/CodeGeneratorExtensions.pm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionController.mm
Log Message:
-----------
Clean up Web Extension logging and add some more logs.
https://webkit.org/b/260416
Reviewed by Brian Weinstein.
Improve a bunch of NSParameterAsserts to check object class not just nil. Added some missing NSParameterAsserts.
Changed some plain RELEASE_LOGs to use a more specific level like DEBUG, INFO or ERROR. Moved API logging to the
code generator and removed the manual logs from the API implementations.
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtension.mm:
(+[_WKWebExtension extensionWithAppExtensionBundle:]):
(+[_WKWebExtension extensionWithResourceBaseURL:]):
(-[_WKWebExtension initWithAppExtensionBundle:error:]):
(-[_WKWebExtension initWithResourceBaseURL:error:]):
(-[_WKWebExtension _initWithManifestDictionary:]):
(-[_WKWebExtension _initWithManifestDictionary:resources:]):
(-[_WKWebExtension _initWithResources:]):
(-[_WKWebExtension _hasStaticInjectedContentForURL:]):
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionContext.mm:
(+[_WKWebExtensionContext contextForExtension:]):
(-[_WKWebExtensionContext initForExtension:]):
(-[_WKWebExtensionContext setBaseURL:]):
(-[_WKWebExtensionContext setUniqueIdentifier:]):
(toImpl):
(-[_WKWebExtensionContext setGrantedPermissions:]):
(-[_WKWebExtensionContext setGrantedPermissionMatchPatterns:]):
(-[_WKWebExtensionContext setDeniedPermissions:]):
(-[_WKWebExtensionContext setDeniedPermissionMatchPatterns:]):
(-[_WKWebExtensionContext hasPermission:]):
(-[_WKWebExtensionContext hasPermission:inTab:]):
(-[_WKWebExtensionContext hasAccessToURL:]):
(-[_WKWebExtensionContext hasAccessToURL:inTab:]):
(-[_WKWebExtensionContext permissionStatusForPermission:]):
(-[_WKWebExtensionContext permissionStatusForPermission:inTab:]):
(-[_WKWebExtensionContext setPermissionStatus:forPermission:]):
(-[_WKWebExtensionContext setPermissionStatus:forPermission:expirationDate:]):
(-[_WKWebExtensionContext permissionStatusForURL:]):
(-[_WKWebExtensionContext permissionStatusForURL:inTab:]):
(-[_WKWebExtensionContext setPermissionStatus:forURL:]):
(-[_WKWebExtensionContext setPermissionStatus:forURL:expirationDate:]):
(-[_WKWebExtensionContext permissionStatusForMatchPattern:]):
(-[_WKWebExtensionContext permissionStatusForMatchPattern:inTab:]):
(-[_WKWebExtensionContext setPermissionStatus:forMatchPattern:]):
(-[_WKWebExtensionContext setPermissionStatus:forMatchPattern:expirationDate:]):
(-[_WKWebExtensionContext hasInjectedContentForURL:]):
(-[_WKWebExtensionContext hasActiveUserGestureInTab:]):
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionController.mm:
(-[_WKWebExtensionController initWithConfiguration:]):
(-[_WKWebExtensionController loadExtensionContext:error:]):
(-[_WKWebExtensionController unloadExtensionContext:error:]):
(-[_WKWebExtensionController extensionContextForExtension:]):
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionControllerConfiguration.mm:
(+[_WKWebExtensionControllerConfiguration configurationWithIdentifier:]):
(-[_WKWebExtensionControllerConfiguration encodeWithCoder:]):
(-[_WKWebExtensionControllerConfiguration initWithCoder:]):
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionMatchPattern.mm:
(-[_WKWebExtensionMatchPattern initWithCoder:]):
(-[_WKWebExtensionMatchPattern encodeWithCoder:]):
(+[_WKWebExtensionMatchPattern registerCustomURLScheme:]):
(+[_WKWebExtensionMatchPattern matchPatternWithString:]):
(+[_WKWebExtensionMatchPattern matchPatternWithScheme:host:path:]):
(-[_WKWebExtensionMatchPattern initWithString:error:]):
(-[_WKWebExtensionMatchPattern initWithScheme:host:path:error:]):
(-[_WKWebExtensionMatchPattern matchesURL:options:]):
(-[_WKWebExtensionMatchPattern matchesPattern:options:]):
* Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPITestCocoa.mm:
(WebKit::WebExtensionContext::testResult):
(WebKit::WebExtensionContext::testEqual):
(WebKit::WebExtensionContext::testMessage):
(WebKit::WebExtensionContext::testYielded):
(WebKit::WebExtensionContext::testFinished):
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm:
(WebKit::WebExtension::resourceFileURLForPath):
(WebKit::WebExtension::recordError):
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::load):
(WebKit::WebExtensionContext::unload):
(WebKit::WebExtensionContext::readStateFromStorage):
(WebKit::WebExtensionContext::writeStateToStorage const):
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerCocoa.mm:
(WebKit::WebExtensionController::load):
(WebKit::WebExtensionController::unload):
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionControllerConfiguration.mm:
(WebKit::WebExtensionControllerConfiguration::createStorageDirectoryPath):
* Source/WebKit/UIProcess/Extensions/WebExtensionAlarm.cpp:
(WebKit::WebExtensionAlarm::schedule):
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:
(WebKit::WebExtensionContext::storageIsPersistent const): Also check m_storageDirectory.isEmpty().
This resolves an error that was being logged during tests.
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIAlarmsCocoa.mm:
(WebKit::WebExtensionAPIAlarms::createAlarm):
(WebKit::WebExtensionAPIAlarms::get):
(WebKit::WebExtensionAPIAlarms::getAll):
(WebKit::WebExtensionAPIAlarms::clear):
(WebKit::WebExtensionAPIAlarms::clearAll):
(WebKit::WebExtensionContextProxy::dispatchAlarmEvent):
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIPermissionsCocoa.mm:
(WebKit::WebExtensionAPIPermissions::getAll):
(WebKit::WebExtensionAPIPermissions::contains):
(WebKit::WebExtensionAPIPermissions::request):
(WebKit::WebExtensionAPIPermissions::remove):
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIRuntimeCocoa.mm:
(WebKit::WebExtensionAPIRuntimeBase::reportErrorForCallbackHandler):
* Source/WebKit/WebProcess/Extensions/Bindings/Cocoa/JSWebExtensionWrapperCocoa.mm:
(WebKit::WebExtensionCallbackHandler::reportError):
* Source/WebKit/WebProcess/Extensions/Bindings/Scripts/CodeGeneratorExtensions.pm:
(_generateImplementationFile):
(_callString):
(_installAutomaticExceptions):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionController.mm:
(TestWebKitAPI::TEST): Drive-by to use non-persistent storage to resolve an error being logged during tests.
Canonical link: https://commits.webkit.org/267111@main
More information about the webkit-changes
mailing list