The name NetworkLoadChecker::returnError() is disingenuous as this function can either return a ResourceRequest object or an Error object. We should come up with more accurate name for this function.
Created attachment 338893 [details] Patch
Comment on attachment 338893 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=338893&action=review > Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:193 > String message = makeString("Unsafe attempt to load URL ", request.url().stringCenterEllipsizedToLength(), " from origin ", m_origin->toString(), ". Domains, protocols and ports must match.\n"); Will rename message to error before landing.
Comment on attachment 338893 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=338893&action=review > Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:147 > +NetworkLoadChecker::RequestOrError NetworkLoadChecker::createRequestOrError(String&& error) createRequestOrError seems a bit odd. How about createValidationError?
(In reply to youenn fablet from comment #3) > Comment on attachment 338893 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=338893&action=review > > > Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:147 > > +NetworkLoadChecker::RequestOrError NetworkLoadChecker::createRequestOrError(String&& error) > > createRequestOrError seems a bit odd. > How about createValidationError? From our IRC conversation, will rename to accessControlErrorForValidationHandler.
(In reply to Daniel Bates from comment #2) > Comment on attachment 338893 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=338893&action=review > > > Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:193 > > String message = makeString("Unsafe attempt to load URL ", request.url().stringCenterEllipsizedToLength(), " from origin ", m_origin->toString(), ". Domains, protocols and ports must match.\n"); > > Will rename message to error before landing. Actually will keep as-is and rename argument to accessControlErrorForValidationHandler() to message to describe that its argument represents the error message for the access control error. Will change other locals named "error" to "message" when passed to accessControlErrorForValidationHandler().
Committed r231059: <https://trac.webkit.org/changeset/231059>
<rdar://problem/39764569>