Chromium Code Reviews| Index: content/browser/loader/url_loader_request_handler.h |
| diff --git a/content/browser/loader/url_loader_request_handler.h b/content/browser/loader/url_loader_request_handler.h |
| index f72cc2a88e5d2cd45ef1d7ef6356387276b4cd1f..2bf9f6deecac22df7489c268ee0afe4d1a046c76 100644 |
| --- a/content/browser/loader/url_loader_request_handler.h |
| +++ b/content/browser/loader/url_loader_request_handler.h |
| @@ -5,17 +5,21 @@ |
| #ifndef CONTENT_BROWSER_LOADER_URL_LOADER_REQUEST_HANDLER_H_ |
| #define CONTENT_BROWSER_LOADER_URL_LOADER_REQUEST_HANDLER_H_ |
| +#include <memory> |
| #include "base/callback_forward.h" |
| #include "base/macros.h" |
| -#include "content/common/url_loader_factory.mojom.h" |
| +#include "content/common/url_loader.mojom.h" |
| namespace content { |
| class ResourceContext; |
| struct ResourceRequest; |
| -using LoaderFactoryCallback = |
| - base::OnceCallback<void(mojom::URLLoaderFactory*)>; |
| +using StartLoaderCallback = |
| + base::OnceCallback<void(mojom::URLLoaderAssociatedRequest request, |
|
jam
2017/06/06 17:45:31
actually, can this now be URLLoaderRequest instead
kinuko
2017/06/07 03:41:25
Hmm, down the chain we still pass this request to
|
| + mojom::URLLoaderClientPtr client)>; |
| + |
| +using LoaderCallback = base::OnceCallback<void(StartLoaderCallback)>; |
| // An instance of this class is a per-request object and kept around during |
| // the lifetime of a request (including multiple redirect legs) on IO thread. |
| @@ -24,21 +28,11 @@ class CONTENT_EXPORT URLLoaderRequestHandler { |
| URLLoaderRequestHandler() = default; |
| virtual ~URLLoaderRequestHandler() = default; |
| - // Calls |callback| with non-null factory if this handler can handle |
| - // the request, calls it with nullptr otherwise. |
| - // Some implementation notes: |
| - // 1) The returned pointer needs to be valid only until a single |
| - // CreateLoaderAndStart call is made, and it is okay to do CHECK(false) for |
| - // any subsequent calls. |
| - // 2) The implementor is not supposed to set up and return URLLoaderFactory |
| - // until it finds out that the handler is really going to handle the |
| - // request. (For example ServiceWorker's request handler would not need to |
| - // call the callback until it gets response from SW, and it may still |
| - // call the callback with nullptr if it turns out that it needs to fallback |
| - // to the network.) |
| - virtual void MaybeCreateLoaderFactory(const ResourceRequest& resource_request, |
| - ResourceContext* resource_context, |
| - LoaderFactoryCallback callback) = 0; |
| + // Calls non-null |callback| if this handler can handle the request, calls |
|
yhirano
2017/06/07 01:35:10
"Calls |callback| with a non-null StartLoaderCallb
kinuko
2017/06/07 03:41:25
Done. (Will be updated in the patch to be uploaded
|
| + // it with null callback otherwise. |
| + virtual void MaybeCreateLoader(const ResourceRequest& resource_request, |
| + ResourceContext* resource_context, |
| + LoaderCallback callback) = 0; |
| }; |
| } // namespace content |