| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 void SetSubresourceLoadInfo( | 104 void SetSubresourceLoadInfo( |
| 105 std::unique_ptr<SubresourceLoadInfo> subresource_load_info, | 105 std::unique_ptr<SubresourceLoadInfo> subresource_load_info, |
| 106 URLLoaderFactoryGetter* default_url_loader); | 106 URLLoaderFactoryGetter* default_url_loader); |
| 107 | 107 |
| 108 // Ownership of the |handler| is transferred to us via this call. This is | 108 // Ownership of the |handler| is transferred to us via this call. This is |
| 109 // only for subresource requests. | 109 // only for subresource requests. |
| 110 void set_request_handler(std::unique_ptr<AppCacheRequestHandler> handler) { | 110 void set_request_handler(std::unique_ptr<AppCacheRequestHandler> handler) { |
| 111 sub_resource_handler_ = std::move(handler); | 111 sub_resource_handler_ = std::move(handler); |
| 112 } | 112 } |
| 113 | 113 |
| 114 // Binds to the URLLoaderRequest instance passed in the |request| parameter. |
| 115 // The URLLoaderClient instance is passed in the |client| parameter. This |
| 116 // enables the client to receive notifications/data, etc for the ensuing |
| 117 // URL load. |
| 118 void BindRequest(mojom::URLLoaderClientPtr client, |
| 119 mojom::URLLoaderRequest request); |
| 120 |
| 114 protected: | 121 protected: |
| 115 // AppCacheJob::Create() creates this instance. | 122 // AppCacheJob::Create() creates this instance. |
| 116 friend class AppCacheJob; | 123 friend class AppCacheJob; |
| 117 | 124 |
| 118 AppCacheURLLoaderJob(const ResourceRequest& request, | 125 AppCacheURLLoaderJob(const ResourceRequest& request, |
| 119 AppCacheURLLoaderRequest* appcache_request, | 126 AppCacheURLLoaderRequest* appcache_request, |
| 120 AppCacheStorage* storage); | 127 AppCacheStorage* storage); |
| 121 | 128 |
| 122 // AppCacheStorage::Delegate methods | 129 // AppCacheStorage::Delegate methods |
| 123 void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, | 130 void OnResponseInfoLoaded(AppCacheResponseInfo* response_info, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // The AppCacheURLLoaderRequest instance. We use this to set the response | 212 // The AppCacheURLLoaderRequest instance. We use this to set the response |
| 206 // info when we receive it. | 213 // info when we receive it. |
| 207 AppCacheURLLoaderRequest* appcache_request_; | 214 AppCacheURLLoaderRequest* appcache_request_; |
| 208 | 215 |
| 209 DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderJob); | 216 DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderJob); |
| 210 }; | 217 }; |
| 211 | 218 |
| 212 } // namespace content | 219 } // namespace content |
| 213 | 220 |
| 214 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_ | 221 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_ |
| OLD | NEW |