Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: content/browser/appcache/appcache_request_handler.h

Issue 2982363002: Add support for fallback content for the frame. This includes main and subframes. (Closed)
Patch Set: Address review comments. Add the fallback function as a parameter to LoaderCallback Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_REQUEST_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 // AppCacheHost::Observer override 160 // AppCacheHost::Observer override
161 void OnCacheSelectionComplete(AppCacheHost* host) override; 161 void OnCacheSelectionComplete(AppCacheHost* host) override;
162 162
163 // URLLoaderRequestHandler override 163 // URLLoaderRequestHandler override
164 void MaybeCreateLoader(const ResourceRequest& resource_request, 164 void MaybeCreateLoader(const ResourceRequest& resource_request,
165 ResourceContext* resource_context, 165 ResourceContext* resource_context,
166 LoaderCallback callback) override; 166 LoaderCallback callback) override;
167 mojom::URLLoaderFactoryPtr MaybeCreateSubresourceFactory() override; 167 mojom::URLLoaderFactoryPtr MaybeCreateSubresourceFactory() override;
168 168
169 // Returns true if a fallback response was returned for the network
170 // |response| passed in.
171 bool MaybeGetFallbackForResponse(const ResourceResponseHead& response,
172 mojom::URLLoaderClientPtr client,
173 mojom::URLLoaderRequest request);
174
169 // Data members ----------------------------------------------- 175 // Data members -----------------------------------------------
170 176
171 // What host we're servicing a request for. 177 // What host we're servicing a request for.
172 AppCacheHost* host_; 178 AppCacheHost* host_;
173 179
174 // Frame vs subresource vs sharedworker loads are somewhat different. 180 // Frame vs subresource vs sharedworker loads are somewhat different.
175 ResourceType resource_type_; 181 ResourceType resource_type_;
176 182
177 // True if corresponding AppCache group should be resetted before load. 183 // True if corresponding AppCache group should be resetted before load.
178 bool should_reset_appcache_; 184 bool should_reset_appcache_;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 int cache_id_; 227 int cache_id_;
222 GURL manifest_url_; 228 GURL manifest_url_;
223 229
224 // Backptr to the central service object. 230 // Backptr to the central service object.
225 AppCacheServiceImpl* service_; 231 AppCacheServiceImpl* service_;
226 232
227 std::unique_ptr<AppCacheRequest> request_; 233 std::unique_ptr<AppCacheRequest> request_;
228 234
229 // Network service related members. 235 // Network service related members.
230 236
231 // In the network service world we are queried via the URLLoaderRequestHandler
232 // interface to see if the navigation request can be handled via the
233 // AppCache. We hold onto the AppCache job created here until the client
234 // binds to it (Serviced via AppCache). If the request cannot be handled via
235 // the AppCache, we delete the job.
236 std::unique_ptr<AppCacheJob> navigation_request_job_;
237
238 // In the network service world, points to the getter for the network URL 237 // In the network service world, points to the getter for the network URL
239 // loader. 238 // loader.
240 scoped_refptr<URLLoaderFactoryGetter> network_url_loader_factory_getter_; 239 scoped_refptr<URLLoaderFactoryGetter> network_url_loader_factory_getter_;
241 240
242 friend class content::AppCacheRequestHandlerTest; 241 friend class content::AppCacheRequestHandlerTest;
243 242
244 // Subresource load information. 243 // Subresource load information.
245 std::unique_ptr<SubresourceLoadInfo> subresource_load_info_; 244 std::unique_ptr<SubresourceLoadInfo> subresource_load_info_;
246 245
247 // The AppCache host instance. We pass this to the 246 // The AppCache host instance. We pass this to the
248 // AppCacheSubresourceURLFactory instance on creation. 247 // AppCacheSubresourceURLFactory instance on creation.
249 base::WeakPtr<AppCacheHost> appcache_host_; 248 base::WeakPtr<AppCacheHost> appcache_host_;
250 249
251 DISALLOW_COPY_AND_ASSIGN(AppCacheRequestHandler); 250 DISALLOW_COPY_AND_ASSIGN(AppCacheRequestHandler);
252 }; 251 };
253 252
254 } // namespace content 253 } // namespace content
255 254
256 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ 255 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698