Bug 61920 - DocumentThreadableLoader should return meaningful error codes.
Summary: DocumentThreadableLoader should return meaningful error codes.
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-02 05:16 PDT by Bill Budge
Modified: 2011-06-03 10:31 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Budge 2011-06-02 05:16:36 PDT
ResourceError has an integer 'reason' field to specify the type of error. DocumentThreadableLoader always sets this to 0. BlobResourceHandle sets this to private error codes. Create a system of error codes to describe Resource access errors.
Comment 1 Alexey Proskuryakov 2011-06-02 22:48:08 PDT
I don't see the word "reason" anywhere in ResourceError.h or ResourceErrorBase.h.
Comment 2 Bill Budge 2011-06-03 05:26:58 PDT
Sorry, 'reason' is the name of the field in the WebKit::WebURLError wrapper struct. The description should say:

" ResourceErrorBase has an integer 'm_errorCode' field to specify the type of error. DocumentThreadableLoader always sets this to 0. BlobResourceHandle sets this to private error codes. Create a system of error codes to describe Resource access errors."
Comment 3 Alexey Proskuryakov 2011-06-03 09:07:08 PDT
Both are correct in this regard. There is an m_domain field, and every domain owner uses whatever codes it likes.

Apparently, we never needed to differentiate between errors in internal WebKit domain, so always using 0 is fine. On the other hand, ResourceErrorMac copies error code and domain from NSError - and the domain could be CFNetwork, SSL, POSIX, or something else along those lines.
Comment 4 Bill Budge 2011-06-03 10:03:40 PDT
Renaming this issue to reflect the fact that this should only affect DocumentThreadableLoader. ThreadableLoader should define integer values for types of access errors and set those on the ResourceErrors it returns, so we can return better error codes at higher levels of WebKit and Chromium.
Comment 5 Alexey Proskuryakov 2011-06-03 10:31:53 PDT
Note that DocumentThreadableLoader creates errors in internal domain. Internal means that these should never go to the client, or at least that we don't want the client to care about details. Errors that are meaningful to the client are defined in each WebKit - see e.g. WebKit/mac/Misc/WebKitErrors.h.

If DocumentThreadableLoader creates errors that can be meaningful to clients, it should call WebKit to create those via FrameLoaderClient.