[webkit-reviews] review requested: [Bug 183303] Share common WebError implementation : [Attachment 334932] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 2 14:56:15 PST 2018


Don Olmstead <don.olmstead at sony.com> has asked	for review:
Bug 183303: Share common WebError implementation
https://bugs.webkit.org/show_bug.cgi?id=183303

Attachment 334932: Patch

https://bugs.webkit.org/attachment.cgi?id=334932&action=review




--- Comment #2 from Don Olmstead <don.olmstead at sony.com> ---
Comment on attachment 334932
  --> https://bugs.webkit.org/attachment.cgi?id=334932
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=334932&action=review

Here's one potential approach to this.

I don't care that much for PLATFORM checks but I'm not seeing any Generic files
within WebKit so I'm not sure about the policy here.

> Source/WebKit/Shared/WebErrors.cpp:91
> +#if !PLATFORM(COCOA)
> +ResourceError cancelledError(const ResourceRequest& request)
> +{
> +    return ResourceError(API::Error::webKitNetworkErrorDomain(),
API::Error::Network::Cancelled, request.url(), WEB_UI_STRING("Load request
cancelled", "Load request cancelled"));
> +}
> +
> +ResourceError fileDoesNotExistError(const ResourceResponse& response)
> +{
> +    return ResourceError(API::Error::webKitNetworkErrorDomain(),
API::Error::Network::FileDoesNotExist, response.url(), WEB_UI_STRING("File does
not exist", "The requested file doesn't exist"));
> +}
> +#endif

Cocoa has its own implementation of this

> Source/WebKit/Shared/glib/WebErrorsGlib.cpp:-50
> -ResourceError cancelledError(const ResourceRequest& request)
> -{
> -    return ResourceError(API::Error::webKitNetworkErrorDomain(),
API::Error::Network::Cancelled, request.url(), WEB_UI_STRING("Load request
cancelled", "Load request cancelled"));
> -}
> -
> -ResourceError fileDoesNotExistError(const ResourceResponse& response)
> -{
> -    return ResourceError(API::Error::webKitNetworkErrorDomain(),
API::Error::Network::FileDoesNotExist, response.url(), WEB_UI_STRING("File does
not exist", "The requested file doesn't exist"));
> -}
> -
> -} // namespace WebKit

Nothing about this file is really glib specific.


More information about the webkit-reviews mailing list