Chromium Code Reviews| Index: content/browser/appcache/appcache_url_loader_job.h |
| diff --git a/content/browser/appcache/appcache_url_loader_job.h b/content/browser/appcache/appcache_url_loader_job.h |
| index 59f620358389a313326dc7a1f09a7413e72402ce..cd21dcb3f3171bcc76295f9ac46514aefd1e154d 100644 |
| --- a/content/browser/appcache/appcache_url_loader_job.h |
| +++ b/content/browser/appcache/appcache_url_loader_job.h |
| @@ -26,9 +26,9 @@ |
| namespace content { |
| class AppCacheRequest; |
| +class AppCacheURLLoaderRequest; |
| class NetToMojoPendingBuffer; |
| class URLLoaderFactoryGetter; |
| -struct SubresourceLoadInfo; |
| // Holds information about the subresource load request like the routing id, |
| // request id, the client pointer, etc. |
| @@ -49,7 +49,8 @@ struct SubresourceLoadInfo { |
| // responses stored in the AppCache. |
| class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob, |
| public AppCacheStorage::Delegate, |
| - public mojom::URLLoader { |
| + public mojom::URLLoader, |
| + public mojom::URLLoaderClient { |
| public: |
| ~AppCacheURLLoaderJob() override; |
| @@ -73,6 +74,22 @@ class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob, |
| void SetPriority(net::RequestPriority priority, |
| int32_t intra_priority_value) override; |
| + // mojom::URLLoaderClient implementation |
|
michaeln
2017/07/17 21:04:55
maybe comment on how these methods apply to the ne
ananta
2017/07/18 00:19:03
Done.
|
| + void OnReceiveResponse(const ResourceResponseHead& response_head, |
| + const base::Optional<net::SSLInfo>& ssl_info, |
| + mojom::DownloadedTempFilePtr downloaded_file) override; |
| + void OnReceiveRedirect(const net::RedirectInfo& redirect_info, |
| + const ResourceResponseHead& response_head) override; |
| + void OnDataDownloaded(int64_t data_len, int64_t encoded_data_len) override; |
| + void OnUploadProgress(int64_t current_position, |
| + int64_t total_size, |
| + OnUploadProgressCallback ack_callback) override; |
| + void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override; |
| + void OnTransferSizeUpdated(int32_t transfer_size_diff) override; |
| + void OnStartLoadingResponseBody( |
| + mojo::ScopedDataPipeConsumerHandle body) override; |
| + void OnComplete(const ResourceRequestCompletionStatus& status) override; |
| + |
| void set_main_resource_loader_callback(LoaderCallback callback) { |
| main_resource_loader_callback_ = std::move(callback); |
| } |
| @@ -97,6 +114,7 @@ class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob, |
| friend class AppCacheJob; |
| AppCacheURLLoaderJob(const ResourceRequest& request, |
| + AppCacheURLLoaderRequest* url_loader_request, |
| AppCacheStorage* storage); |
| // AppCacheStorage::Delegate methods |
| @@ -120,6 +138,11 @@ class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob, |
| // Notifies the client about request completion. |
| void NotifyCompleted(int error_code); |
| + // Creates the URLLoaderClient proxy. Used to setup the proxy URLLoaderClient |
| + // which enables us to inspect responses coming back from the network service |
| + // for AppCache fallback. |
| + mojom::URLLoaderClientPtr CreateLoaderClientProxy(); |
| + |
| // The current request. |
| ResourceRequest request_; |
| @@ -181,6 +204,13 @@ class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob, |
| std::unique_ptr<mojo::AssociatedBinding<mojom::URLLoader>> |
| associated_binding_; |
| + // Proxy URLLoaderClient binding for subresource requests. |
| + mojo::Binding<mojom::URLLoaderClient> loader_client_proxy_binding_; |
| + |
| + // The AppCacheURLLoaderRequest instance. We use this to set the response |
| + // info when we receive it. |
| + AppCacheURLLoaderRequest* url_loader_request_instance_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderJob); |
| }; |