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

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

Issue 2954853002: Use Independent URLLoader
Patch Set: . Created 3 years, 6 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
« no previous file with comments | « no previous file | content/browser/appcache/appcache_subresource_url_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 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_SUBRESOURCE_URL_FACTORY_H_ 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_SUBRESOURCE_URL_FACTORY_H_
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_SUBRESOURCE_URL_FACTORY_H_ 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_SUBRESOURCE_URL_FACTORY_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "content/common/url_loader_factory.mojom.h" 9 #include "content/common/url_loader_factory.mojom.h"
10 #include "mojo/public/cpp/bindings/binding.h" 10 #include "mojo/public/cpp/bindings/binding.h"
(...skipping 13 matching lines...) Expand all
24 24
25 // Factory function to create an instance of the factory. 25 // Factory function to create an instance of the factory.
26 // 1. The |factory_getter| parameter is used to query the network service 26 // 1. The |factory_getter| parameter is used to query the network service
27 // to pass network requests to. 27 // to pass network requests to.
28 // Returns a URLLoaderFactoryPtr instance which controls the lifetime of the 28 // Returns a URLLoaderFactoryPtr instance which controls the lifetime of the
29 // factory. 29 // factory.
30 static mojom::URLLoaderFactoryPtr CreateURLLoaderFactory( 30 static mojom::URLLoaderFactoryPtr CreateURLLoaderFactory(
31 URLLoaderFactoryGetter* factory_getter); 31 URLLoaderFactoryGetter* factory_getter);
32 32
33 // mojom::URLLoaderFactory implementation. 33 // mojom::URLLoaderFactory implementation.
34 void CreateLoaderAndStart( 34 void CreateLoaderAndStart(mojom::URLLoaderRequest url_loader_request,
35 mojom::URLLoaderAssociatedRequest url_loader_request, 35 int32_t routing_id,
36 int32_t routing_id, 36 int32_t request_id,
37 int32_t request_id, 37 uint32_t options,
38 uint32_t options, 38 const ResourceRequest& request,
39 const ResourceRequest& request, 39 mojom::URLLoaderClientPtr client,
40 mojom::URLLoaderClientPtr client, 40 const net::MutableNetworkTrafficAnnotationTag&
41 const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) 41 traffic_annotation) override;
42 override;
43 void SyncLoad(int32_t routing_id, 42 void SyncLoad(int32_t routing_id,
44 int32_t request_id, 43 int32_t request_id,
45 const ResourceRequest& request, 44 const ResourceRequest& request,
46 SyncLoadCallback callback) override; 45 SyncLoadCallback callback) override;
47 46
48 private: 47 private:
49 AppCacheSubresourceURLFactory(mojom::URLLoaderFactoryRequest request, 48 AppCacheSubresourceURLFactory(mojom::URLLoaderFactoryRequest request,
50 URLLoaderFactoryGetter* factory_getter); 49 URLLoaderFactoryGetter* factory_getter);
51 50
52 void OnConnectionError(); 51 void OnConnectionError();
53 52
54 // Mojo binding. 53 // Mojo binding.
55 mojo::Binding<mojom::URLLoaderFactory> binding_; 54 mojo::Binding<mojom::URLLoaderFactory> binding_;
56 55
57 // Used to retrieve the network service factory to pass unhandled requests to 56 // Used to retrieve the network service factory to pass unhandled requests to
58 // the network service. 57 // the network service.
59 scoped_refptr<URLLoaderFactoryGetter> default_url_loader_factory_getter_; 58 scoped_refptr<URLLoaderFactoryGetter> default_url_loader_factory_getter_;
60 59
61 DISALLOW_COPY_AND_ASSIGN(AppCacheSubresourceURLFactory); 60 DISALLOW_COPY_AND_ASSIGN(AppCacheSubresourceURLFactory);
62 }; 61 };
63 62
64 } // namespace content 63 } // namespace content
65 64
66 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_FACTORY_H_ 65 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/appcache/appcache_subresource_url_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698