Changeset 218244 in webkit
- Timestamp:
- Jun 13, 2017 11:31:11 PM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r218229 r218244 1 2017-06-13 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Do not mix C and C++ API error constants 4 https://bugs.webkit.org/show_bug.cgi?id=173311 5 6 Reviewed by Alex Christensen. 7 8 In r214934 I added error constants to API::Error, but not for all errors exposed in the C API. Because of this 9 we are mixing both constants in WebErrors and in GTk+ WebKitPrivate. 10 11 * Shared/API/APIError.h: 12 * Shared/WebErrors.cpp: 13 (WebKit::blockedError): 14 (WebKit::blockedByContentBlockerError): 15 (WebKit::cannotShowURLError): 16 (WebKit::interruptedForPolicyChangeError): 17 (WebKit::blockedByContentFilterError): 18 (WebKit::cannotShowMIMETypeError): 19 (WebKit::pluginWillHandleLoadError): 20 (WebKit::internalError): 21 * UIProcess/API/gtk/WebKitPrivate.cpp: 22 (toWebKitError): 23 (toWebCoreError): 24 1 25 2017-06-13 Matt Rajca <mrajca@apple.com> 2 26 -
trunk/Source/WebKit2/Shared/API/APIError.h
r214934 r218244 49 49 } 50 50 51 enum General { 52 Internal = 300 53 }; 51 54 static const WTF::String& webKitErrorDomain(); 52 enum Network { Cancelled = 302, FileDoesNotExist = 303 }; 55 56 enum Network { 57 Cancelled = 302, 58 FileDoesNotExist = 303 59 }; 53 60 static const WTF::String& webKitNetworkErrorDomain(); 61 62 enum Policy { 63 CannotShowMIMEType = 100, 64 CannotShowURL = 101, 65 FrameLoadInterruptedByPolicyChange = 102, 66 CannotUseRestrictedPort = 103, 67 FrameLoadBlockedByContentBlocker = 104, 68 FrameLoadBlockedByContentFilter = 105 69 }; 54 70 static const WTF::String& webKitPolicyErrorDomain(); 71 72 enum Plugin { 73 CannotFindPlugIn = 200, 74 CannotLoadPlugIn = 201, 75 JavaUnavailable = 202, 76 PlugInCancelledConnection = 203, 77 PlugInWillHandleLoad = 204, 78 InsecurePlugInVersion = 205 79 }; 55 80 static const WTF::String& webKitPluginErrorDomain(); 81 56 82 #if USE(SOUP) 57 enum Download { Transport = 499, CancelledByUser = 400, Destination = 401 }; 83 enum Download { 84 Transport = 499, 85 CancelledByUser = 400, 86 Destination = 401 87 }; 58 88 static const WTF::String& webKitDownloadErrorDomain(); 59 89 #endif 90 60 91 #if PLATFORM(GTK) 61 enum Print { General = 599, PrinterNotFound = 500, InvalidPageRange = 501 }; 92 enum Print { 93 General = 599, 94 PrinterNotFound = 500, 95 InvalidPageRange = 501 96 }; 62 97 static const WTF::String& webKitPrintErrorDomain(); 63 98 #endif 64 65 99 66 100 const WTF::String& domain() const { return m_platformError.domain(); } -
trunk/Source/WebKit2/Shared/WebErrors.cpp
r214934 r218244 28 28 29 29 #include "APIError.h" 30 #include "WKErrorRef.h"31 30 #include <WebCore/LocalizedStrings.h> 32 31 #include <WebCore/ResourceRequest.h> … … 39 38 ResourceError blockedError(const ResourceRequest& request) 40 39 { 41 return ResourceError(API::Error::webKitPolicyErrorDomain(), kWKErrorCodeCannotUseRestrictedPort, request.url(), WEB_UI_STRING("Not allowed to use restricted network port", "WebKitErrorCannotUseRestrictedPort description"));40 return ResourceError(API::Error::webKitPolicyErrorDomain(), API::Error::Policy::CannotUseRestrictedPort, request.url(), WEB_UI_STRING("Not allowed to use restricted network port", "WebKitErrorCannotUseRestrictedPort description")); 42 41 } 43 42 44 43 ResourceError blockedByContentBlockerError(const ResourceRequest& request) 45 44 { 46 return ResourceError(API::Error::webKitPolicyErrorDomain(), kWKErrorCodeFrameLoadBlockedByContentBlocker, request.url(), WEB_UI_STRING("The URL was blocked by a content blocker", "WebKitErrorBlockedByContentBlocker description"));45 return ResourceError(API::Error::webKitPolicyErrorDomain(), API::Error::Policy::FrameLoadBlockedByContentBlocker, request.url(), WEB_UI_STRING("The URL was blocked by a content blocker", "WebKitErrorBlockedByContentBlocker description")); 47 46 } 48 47 49 48 ResourceError cannotShowURLError(const ResourceRequest& request) 50 49 { 51 return ResourceError(API::Error::webKitPolicyErrorDomain(), kWKErrorCodeCannotShowURL, request.url(), WEB_UI_STRING("The URL can’t be shown", "WebKitErrorCannotShowURL description"));50 return ResourceError(API::Error::webKitPolicyErrorDomain(), API::Error::Policy::CannotShowURL, request.url(), WEB_UI_STRING("The URL can’t be shown", "WebKitErrorCannotShowURL description")); 52 51 } 53 52 54 53 ResourceError interruptedForPolicyChangeError(const ResourceRequest& request) 55 54 { 56 return ResourceError(API::Error::webKitPolicyErrorDomain(), kWKErrorCodeFrameLoadInterruptedByPolicyChange, request.url(), WEB_UI_STRING("Frame load interrupted", "WebKitErrorFrameLoadInterruptedByPolicyChange description"));55 return ResourceError(API::Error::webKitPolicyErrorDomain(), API::Error::Policy::FrameLoadInterruptedByPolicyChange, request.url(), WEB_UI_STRING("Frame load interrupted", "WebKitErrorFrameLoadInterruptedByPolicyChange description")); 57 56 } 58 57 … … 60 59 ResourceError blockedByContentFilterError(const ResourceRequest& request) 61 60 { 62 return ResourceError(API::Error::webKitPolicyErrorDomain(), kWKErrorCodeFrameLoadBlockedByContentFilter, request.url(), WEB_UI_STRING("The URL was blocked by a content filter", "WebKitErrorFrameLoadBlockedByContentFilter description"));61 return ResourceError(API::Error::webKitPolicyErrorDomain(), API::Error::Policy::FrameLoadBlockedByContentFilter, request.url(), WEB_UI_STRING("The URL was blocked by a content filter", "WebKitErrorFrameLoadBlockedByContentFilter description")); 63 62 } 64 63 #endif … … 66 65 ResourceError cannotShowMIMETypeError(const ResourceResponse& response) 67 66 { 68 return ResourceError(API::Error::webKitPolicyErrorDomain(), kWKErrorCodeCannotShowMIMEType, response.url(), WEB_UI_STRING("Content with specified MIME type can’t be shown", "WebKitErrorCannotShowMIMEType description"));67 return ResourceError(API::Error::webKitPolicyErrorDomain(), API::Error::Policy::CannotShowMIMEType, response.url(), WEB_UI_STRING("Content with specified MIME type can’t be shown", "WebKitErrorCannotShowMIMEType description")); 69 68 } 70 69 71 70 ResourceError pluginWillHandleLoadError(const ResourceResponse& response) 72 71 { 73 return ResourceError(API::Error::webKitPluginErrorDomain(), kWKErrorCodePlugInWillHandleLoad, response.url(), WEB_UI_STRING("Plug-in handled load", "WebKitErrorPlugInWillHandleLoad description"));72 return ResourceError(API::Error::webKitPluginErrorDomain(), API::Error::Plugin::PlugInWillHandleLoad, response.url(), WEB_UI_STRING("Plug-in handled load", "WebKitErrorPlugInWillHandleLoad description")); 74 73 } 75 74 76 75 ResourceError internalError(const URL& url) 77 76 { 78 return ResourceError(API::Error::webKitErrorDomain(), kWKErrorInternal, url, WEB_UI_STRING("WebKit encountered an internal error", "WebKitErrorInternal description"));77 return ResourceError(API::Error::webKitErrorDomain(), API::Error::General::Internal, url, WEB_UI_STRING("WebKit encountered an internal error", "WebKitErrorInternal description")); 79 78 } 80 79 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp
r218176 r218244 22 22 23 23 #include "APIError.h" 24 #include "WKErrorRef.h"25 24 #include "WebEvent.h" 26 25 #include "WebKitError.h" … … 87 86 case API::Error::Network::FileDoesNotExist: 88 87 return WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST; 89 case kWKErrorCodeCannotShowMIMEType:88 case API::Error::Policy::CannotShowMIMEType: 90 89 return WEBKIT_POLICY_ERROR_CANNOT_SHOW_MIME_TYPE; 91 case kWKErrorCodeCannotShowURL:90 case API::Error::Policy::CannotShowURL: 92 91 return WEBKIT_POLICY_ERROR_CANNOT_SHOW_URI; 93 case kWKErrorCodeFrameLoadInterruptedByPolicyChange:92 case API::Error::Policy::FrameLoadInterruptedByPolicyChange: 94 93 return WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE; 95 case kWKErrorCodeCannotUseRestrictedPort:94 case API::Error::Policy::CannotUseRestrictedPort: 96 95 return WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT; 97 case kWKErrorCodeCannotFindPlugIn:96 case API::Error::Plugin::CannotFindPlugIn: 98 97 return WEBKIT_PLUGIN_ERROR_CANNOT_FIND_PLUGIN; 99 case kWKErrorCodeCannotLoadPlugIn:98 case API::Error::Plugin::CannotLoadPlugIn: 100 99 return WEBKIT_PLUGIN_ERROR_CANNOT_LOAD_PLUGIN; 101 case kWKErrorCodeJavaUnavailable:100 case API::Error::Plugin::JavaUnavailable: 102 101 return WEBKIT_PLUGIN_ERROR_JAVA_UNAVAILABLE; 103 case kWKErrorCodePlugInCancelledConnection:102 case API::Error::Plugin::PlugInCancelledConnection: 104 103 return WEBKIT_PLUGIN_ERROR_CONNECTION_CANCELLED; 105 case kWKErrorCodePlugInWillHandleLoad:104 case API::Error::Plugin::PlugInWillHandleLoad: 106 105 return WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD; 107 106 case API::Error::Download::Transport: … … 131 130 return API::Error::Network::FileDoesNotExist; 132 131 case WEBKIT_POLICY_ERROR_CANNOT_SHOW_MIME_TYPE: 133 return kWKErrorCodeCannotShowMIMEType;132 return API::Error::Policy::CannotShowMIMEType; 134 133 case WEBKIT_POLICY_ERROR_CANNOT_SHOW_URI: 135 return kWKErrorCodeCannotShowURL;134 return API::Error::Policy::CannotShowURL; 136 135 case WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE: 137 return kWKErrorCodeFrameLoadInterruptedByPolicyChange;136 return API::Error::Policy::FrameLoadInterruptedByPolicyChange; 138 137 case WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT: 139 return kWKErrorCodeCannotUseRestrictedPort;138 return API::Error::Policy::CannotUseRestrictedPort; 140 139 case WEBKIT_PLUGIN_ERROR_CANNOT_FIND_PLUGIN: 141 return kWKErrorCodeCannotFindPlugIn;140 return API::Error::Plugin::CannotFindPlugIn; 142 141 case WEBKIT_PLUGIN_ERROR_CANNOT_LOAD_PLUGIN: 143 return kWKErrorCodeCannotLoadPlugIn;142 return API::Error::Plugin::CannotLoadPlugIn; 144 143 case WEBKIT_PLUGIN_ERROR_JAVA_UNAVAILABLE: 145 return kWKErrorCodeJavaUnavailable;144 return API::Error::Plugin::JavaUnavailable; 146 145 case WEBKIT_PLUGIN_ERROR_CONNECTION_CANCELLED: 147 return kWKErrorCodePlugInCancelledConnection;146 return API::Error::Plugin::PlugInCancelledConnection; 148 147 case WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD: 149 return kWKErrorCodePlugInWillHandleLoad;148 return API::Error::Plugin::PlugInWillHandleLoad; 150 149 case WEBKIT_DOWNLOAD_ERROR_NETWORK: 151 150 return API::Error::Download::Transport;
Note: See TracChangeset
for help on using the changeset viewer.