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

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

Issue 2891773002: Add a stub implementation of the URLLoaderFactory for AppCache. (Closed)
Patch Set: Address final round of comments Created 3 years, 7 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_FACTORY_H_
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_FACTORY_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "content/common/url_loader_factory.mojom.h"
10 #include "mojo/public/cpp/bindings/strong_binding_set.h"
11 #include "url/gurl.h"
12
13 namespace content {
14 class ChromeAppCacheService;
15 class URLLoaderFactoryGetter;
16
17 // Implements the URLLoaderFactory mojom for AppCache requests.
18 class AppCacheURLLoaderFactory : public mojom::URLLoaderFactory {
19 public:
20 ~AppCacheURLLoaderFactory() override;
21
22 // Factory function to create an instance of the factory.
23 // The |appcache_service| parameter is used to query the underlying
24 // AppCacheStorage instance to check if we can service requests from the
25 // AppCache. We pass unhandled requests to the network service retrieved from
26 // the |factory_getter|.
27 static void CreateURLLoaderFactory(mojom::URLLoaderFactoryRequest request,
28 ChromeAppCacheService* appcache_service,
29 URLLoaderFactoryGetter* factory_getter);
30
31 // mojom::URLLoaderFactory implementation.
32 void CreateLoaderAndStart(
33 mojom::URLLoaderAssociatedRequest url_loader_request,
34 int32_t routing_id,
35 int32_t request_id,
36 uint32_t options,
37 const ResourceRequest& request,
38 mojom::URLLoaderClientPtr client) override;
39 void SyncLoad(int32_t routing_id,
40 int32_t request_id,
41 const ResourceRequest& request,
42 SyncLoadCallback callback) override;
43
44 private:
45 AppCacheURLLoaderFactory(ChromeAppCacheService* appcache_service,
46 URLLoaderFactoryGetter* factory_getter);
47
48 // Used to query AppCacheStorage to see if a request can be served out of the
49 /// AppCache.
50 scoped_refptr<ChromeAppCacheService> appcache_service_;
51
52 // Used to retrieve the network service factory to pass unhandled requests to
53 // the network service.
54 scoped_refptr<URLLoaderFactoryGetter> factory_getter_;
55
56 mojo::StrongBindingSet<mojom::URLLoaderFactory> loader_factory_bindings_;
57
58 DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderFactory);
59 };
60
61 } // namespace content
62
63 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_FACTORY_H_
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_request_handler.cc ('k') | content/browser/appcache/appcache_url_loader_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698