Expose content extension failure error codes in SPI
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2016 18:50:24 +0000 (18:50 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2016 18:50:24 +0000 (18:50 +0000)
commit3d82642a33a954a2ce8a66e0054a922177a1bab1
tree8d09802cf712d72b3e6cb779da1a90ded7d5cf97
parente957ccdd5babc97301b9aec4bc0a04d9c38867e6
Expose content extension failure error codes in SPI
https://bugs.webkit.org/show_bug.cgi?id=158095
rdar://problem/26475651

Reviewed by Anders Carlsson.

Source/WebKit2:

* UIProcess/API/APIUserContentExtensionStore.cpp:
(API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
(API::UserContentExtensionStore::invalidateContentExtensionVersion):
Added for testing.
(API::userContentExtensionStoreErrorCategory):
* UIProcess/API/APIUserContentExtensionStore.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
Added the new enum, _WKUserContentExtensionStoreErrorCode.
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
(-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
Sometimes the error code returned by UserContentExtensionStore::compileContentExtension has the error code from compileRuleList.
When this happens, we want to get the message from the internal compiler error, but we want the NSError's code to always be CompileFailed.
(-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
(-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
(-[_WKUserContentExtensionStore _removeAllContentExtensions]):
(-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]):
* UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
Added new invalidator for testing.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/_WKUserContentExtensionStore.mm:
(checkDomain):
(TEST_F):
Add tests that use the new enum.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/APIUserContentExtensionStore.cpp
Source/WebKit2/UIProcess/API/APIUserContentExtensionStore.h
Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentExtensionStore.h
Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm
Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/_WKUserContentExtensionStore.mm