Commit 6192fabc authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

DocumentThreadableLoader cleanup after making sync/async paths nearly-identical.

https://chromium.googlesource.com/chromium/src/+/b5c5c86c21a0bf51cc910e0b62611aea45aa0b0d
removed most of the custom logic for sync requests from
DocumentThreadableLoader. This left a lot of helper methods with only
one caller, where previously there had been two.

* Inline HandleResponse() into ResponseReceived()
* Inline HandleReceivedData() into DataReceived()
* Inline HandleSuccessfulFinish() into NotifyFinished()
* Merge LoadRequestAsync() and LoadRequestSync() paths, and inline
  the single path into LoadRequest().

Change-Id: Ie068b49396c355884e2d71588b35280dbe07a86f
Reviewed-on: https://chromium-review.googlesource.com/1087312
Commit-Queue: Nate Chapin <japhet@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565404}
parent a973fa60
......@@ -134,19 +134,6 @@ class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader,
void ReportResponseReceived(unsigned long identifier,
const ResourceResponse&);
// Methods containing code to handle resource fetch results which are common
// to both sync and async mode.
//
// The FetchCredentialsMode argument must be the request's credentials mode.
// It's used for CORS check.
void HandleResponse(unsigned long identifier,
network::mojom::FetchRequestMode,
network::mojom::FetchCredentialsMode,
const ResourceResponse&,
std::unique_ptr<WebDataConsumerHandle>);
void HandleReceivedData(const char* data, size_t data_length);
void HandleSuccessfulFinish(unsigned long identifier);
void DidTimeout(TimerBase*);
// Calls the appropriate loading method according to policy and data about
// origin. Only for handling the initial load (including fallback after
......@@ -165,15 +152,12 @@ class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader,
// m_client.
void HandlePreflightFailure(const KURL&, const String& error_description);
// Investigates the response for the preflight request. If successful,
// the actual request will be made later in handleSuccessfulFinish().
// the actual request will be made later in NotifyFinished().
void HandlePreflightResponse(const ResourceResponse&);
void DispatchDidFailAccessControlCheck(const ResourceError&);
void DispatchDidFail(const ResourceError&);
void LoadRequestAsync(const ResourceRequest&, ResourceLoaderOptions);
void LoadRequestSync(const ResourceRequest&, ResourceLoaderOptions);
void PrepareCrossOriginRequest(ResourceRequest&) const;
// This method modifies the ResourceRequest by calling
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment