Title: [218315] trunk/Source/WebKit2
- Revision
- 218315
- Author
- [email protected]
- Date
- 2017-06-14 22:38:50 -0700 (Wed, 14 Jun 2017)
Log Message
WKErrorGetErrorCode should not return the API::Error enum values directly
https://bugs.webkit.org/show_bug.cgi?id=173367
Reviewed by Alex Christensen.
Even if the values are the same, we should use a switch to ensure we return the C API values, and not all
API::Error enum values are exposed in the C API.
* Shared/API/c/WKErrorRef.cpp:
(WKErrorGetErrorCode):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (218314 => 218315)
--- trunk/Source/WebKit2/ChangeLog 2017-06-15 04:01:08 UTC (rev 218314)
+++ trunk/Source/WebKit2/ChangeLog 2017-06-15 05:38:50 UTC (rev 218315)
@@ -1,3 +1,16 @@
+2017-06-14 Carlos Garcia Campos <[email protected]>
+
+ WKErrorGetErrorCode should not return the API::Error enum values directly
+ https://bugs.webkit.org/show_bug.cgi?id=173367
+
+ Reviewed by Alex Christensen.
+
+ Even if the values are the same, we should use a switch to ensure we return the C API values, and not all
+ API::Error enum values are exposed in the C API.
+
+ * Shared/API/c/WKErrorRef.cpp:
+ (WKErrorGetErrorCode):
+
2017-06-14 Commit Queue <[email protected]>
Unreviewed, rolling out r218285.
Modified: trunk/Source/WebKit2/Shared/API/c/WKErrorRef.cpp (218314 => 218315)
--- trunk/Source/WebKit2/Shared/API/c/WKErrorRef.cpp 2017-06-15 04:01:08 UTC (rev 218314)
+++ trunk/Source/WebKit2/Shared/API/c/WKErrorRef.cpp 2017-06-15 05:38:50 UTC (rev 218315)
@@ -48,7 +48,37 @@
int WKErrorGetErrorCode(WKErrorRef errorRef)
{
- return toImpl(errorRef)->errorCode();
+ auto errorCode = toImpl(errorRef)->errorCode();
+ switch (errorCode) {
+ case API::Error::Policy::CannotShowMIMEType:
+ return kWKErrorCodeCannotShowMIMEType;
+ case API::Error::Policy::CannotShowURL:
+ return kWKErrorCodeCannotShowURL;
+ case API::Error::Policy::FrameLoadInterruptedByPolicyChange:
+ return kWKErrorCodeFrameLoadInterruptedByPolicyChange;
+ case API::Error::Policy::CannotUseRestrictedPort:
+ return kWKErrorCodeCannotUseRestrictedPort;
+ case API::Error::Policy::FrameLoadBlockedByContentBlocker:
+ return kWKErrorCodeFrameLoadBlockedByContentBlocker;
+ case API::Error::Policy::FrameLoadBlockedByContentFilter:
+ return kWKErrorCodeFrameLoadBlockedByContentFilter;
+ case API::Error::Plugin::CannotFindPlugIn:
+ return kWKErrorCodeCannotFindPlugIn;
+ case API::Error::Plugin::CannotLoadPlugIn:
+ return kWKErrorCodeCannotLoadPlugIn;
+ case API::Error::Plugin::JavaUnavailable:
+ return kWKErrorCodeJavaUnavailable;
+ case API::Error::Plugin::PlugInCancelledConnection:
+ return kWKErrorCodePlugInCancelledConnection;
+ case API::Error::Plugin::PlugInWillHandleLoad:
+ return kWKErrorCodePlugInWillHandleLoad;
+ case API::Error::Plugin::InsecurePlugInVersion:
+ return kWKErrorCodeInsecurePlugInVersion;
+ case API::Error::General::Internal:
+ return kWKErrorInternal;
+ }
+
+ return errorCode;
}
WKURLRef WKErrorCopyFailingURL(WKErrorRef errorRef)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes