Skip to content
Permalink
Browse files
[WinCairo] Fix ResourceError handling in ArgumentCoder for wincairo w…
…ebkit

https://bugs.webkit.org/show_bug.cgi?id=180483

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2017-12-07
Reviewed by Alex Christensen.

* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):

Canonical link: https://commits.webkit.org/196486@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ykimot authored and webkit-commit-queue committed Dec 8, 2017
1 parent 4fbd700 commit d14109494f8d671b10e45844ba083402dc7327f6
Showing 2 changed files with 53 additions and 2 deletions.
@@ -1,3 +1,14 @@
2017-12-07 Yousuke Kimoto <yousuke.kimoto@sony.com>

[WinCairo] Fix ResourceError handling in ArgumentCoder for wincairo webkit
https://bugs.webkit.org/show_bug.cgi?id=180483

Reviewed by Alex Christensen.

* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):

2017-12-07 Youenn Fablet <youenn@apple.com>

StartFetch should take a ServiceWorkerIdentifier
@@ -56,12 +56,52 @@ bool ArgumentCoder<CertificateInfo>::decode(Decoder&, CertificateInfo&)
return true;
}

void ArgumentCoder<ResourceError>::encodePlatformData(Encoder&, const ResourceError&)
void ArgumentCoder<ResourceError>::encodePlatformData(Encoder& encoder, const ResourceError& resourceError)
{
encoder.encodeEnum(resourceError.type());
if (resourceError.isNull())
return;

encoder << resourceError.domain();
encoder << resourceError.errorCode();
encoder << resourceError.failingURL().string();
encoder << resourceError.localizedDescription();
encoder << resourceError.sslErrors();
}

bool ArgumentCoder<ResourceError>::decodePlatformData(Decoder&, ResourceError&)
bool ArgumentCoder<ResourceError>::decodePlatformData(Decoder& decoder, ResourceError& resourceError)
{
ResourceErrorBase::Type errorType;
if (!decoder.decodeEnum(errorType))
return false;
if (errorType == ResourceErrorBase::Type::Null) {
resourceError = { };
return true;
}

String domain;
if (!decoder.decode(domain))
return false;

int errorCode;
if (!decoder.decode(errorCode))
return false;

String failingURL;
if (!decoder.decode(failingURL))
return false;

String localizedDescription;
if (!decoder.decode(localizedDescription))
return false;

unsigned sslErrors;
if (!decoder.decode(sslErrors))
return false;

resourceError = ResourceError(domain, errorCode, URL(URL(), failingURL), localizedDescription, errorType);
resourceError.setSslErrors(sslErrors);

return true;
}

0 comments on commit d141094

Please sign in to comment.