| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_ |
| 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 void SetSubresourceLoadInfo( | 105 void SetSubresourceLoadInfo( |
| 106 std::unique_ptr<SubresourceLoadInfo> subresource_load_info, | 106 std::unique_ptr<SubresourceLoadInfo> subresource_load_info, |
| 107 URLLoaderFactoryGetter* default_url_loader); | 107 URLLoaderFactoryGetter* default_url_loader); |
| 108 | 108 |
| 109 // Ownership of the |handler| is transferred to us via this call. This is | 109 // Ownership of the |handler| is transferred to us via this call. This is |
| 110 // only for subresource requests. | 110 // only for subresource requests. |
| 111 void set_request_handler(std::unique_ptr<AppCacheRequestHandler> handler) { | 111 void set_request_handler(std::unique_ptr<AppCacheRequestHandler> handler) { |
| 112 sub_resource_handler_ = std::move(handler); | 112 sub_resource_handler_ = std::move(handler); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // Binds to the URLLoaderRequest instance passed in the |request| parameter. |
| 116 // The URLLoaderClient instance is passed in the |client| parameter. This |
| 117 // enables the client to receive notifications/data, etc for the ensuing |
| 118 // URL load. |
| 119 void BindRequest(mojom::URLLoaderClientPtr client, |
| 120 mojom::URLLoaderRequest request); |
| 121 |
| 115 protected: | 122 protected: |
| 116 // AppCacheJob::Create() creates this instance. | 123 // AppCacheJob::Create() creates this instance. |
| 117 friend class AppCacheJob; | 124 friend class AppCacheJob; |
| 118 | 125 |
| 119 AppCacheURLLoaderJob(const ResourceRequest& request, | 126 AppCacheURLLoaderJob(const ResourceRequest& request, |
| 120 AppCacheURLLoaderRequest* appcache_request, | 127 AppCacheURLLoaderRequest* appcache_request, |
| 121 AppCacheStorage* storage); | 128 AppCacheStorage* storage); |
| 122 | 129 |
| 123 // AppCacheStorage::Delegate methods | 130 // AppCacheStorage::Delegate methods |
| 124 void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, | 131 void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 // The AppCacheURLLoaderRequest instance. We use this to set the response | 219 // The AppCacheURLLoaderRequest instance. We use this to set the response |
| 213 // info when we receive it. | 220 // info when we receive it. |
| 214 AppCacheURLLoaderRequest* appcache_request_; | 221 AppCacheURLLoaderRequest* appcache_request_; |
| 215 | 222 |
| 216 DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderJob); | 223 DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderJob); |
| 217 }; | 224 }; |
| 218 | 225 |
| 219 } // namespace content | 226 } // namespace content |
| 220 | 227 |
| 221 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_ | 228 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_ |
| OLD | NEW |