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

Side by Side Diff: content/browser/url_loader_factory_getter.h

Issue 2906543002: Add support for reading blobs when using the network service. (Closed)
Patch Set: fix threading issue with weakptr 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 | « content/browser/storage_partition_impl.cc ('k') | content/browser/url_loader_factory_getter.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_URL_LOADER_FACTORY_GETTER_H_ 5 #ifndef CONTENT_BROWSER_URL_LOADER_FACTORY_GETTER_H_
6 #define CONTENT_BROWSER_URL_LOADER_FACTORY_GETTER_H_ 6 #define CONTENT_BROWSER_URL_LOADER_FACTORY_GETTER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 15 matching lines...) Expand all
26 URLLoaderFactoryGetter(); 26 URLLoaderFactoryGetter();
27 27
28 // Initializes this object on the UI thread. The |partition| is used to 28 // Initializes this object on the UI thread. The |partition| is used to
29 // initialize the URLLoaderFactories for the network service and AppCache. 29 // initialize the URLLoaderFactories for the network service and AppCache.
30 void Initialize(StoragePartitionImpl* partition); 30 void Initialize(StoragePartitionImpl* partition);
31 31
32 // Called on the IO thread to get the URLLoaderFactory to the network service. 32 // Called on the IO thread to get the URLLoaderFactory to the network service.
33 // The pointer shouldn't be cached. 33 // The pointer shouldn't be cached.
34 mojom::URLLoaderFactoryPtr* GetNetworkFactory(); 34 mojom::URLLoaderFactoryPtr* GetNetworkFactory();
35 35
36 // Called on the IO thread to get the URLLoaderFactory to the blob service.
37 // The pointer shouldn't be cached.
38 CONTENT_EXPORT mojom::URLLoaderFactoryPtr* GetBlobFactory();
39
36 // Overrides the network URLLoaderFactory for subsequent requests. Passing a 40 // Overrides the network URLLoaderFactory for subsequent requests. Passing a
37 // null pointer will restore the default behavior. 41 // null pointer will restore the default behavior.
38 // This is called on the UI thread. 42 // This is called on the UI thread.
39 CONTENT_EXPORT void SetNetworkFactoryForTesting( 43 CONTENT_EXPORT void SetNetworkFactoryForTesting(
40 mojom::URLLoaderFactoryPtr test_factory); 44 mojom::URLLoaderFactoryPtr test_factory);
41 45
42 // Called on the IO thread to get the URLLoaderFactory for AppCache. The 46 // Called on the IO thread to get the URLLoaderFactory for AppCache. The
43 // pointer should not be cached. 47 // pointer should not be cached.
44 mojom::URLLoaderFactoryPtr* GetAppCacheFactory(); 48 mojom::URLLoaderFactoryPtr* GetAppCacheFactory();
45 49
46 private: 50 private:
47 friend class base::DeleteHelper<URLLoaderFactoryGetter>; 51 friend class base::DeleteHelper<URLLoaderFactoryGetter>;
48 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; 52 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>;
49 53
50 CONTENT_EXPORT ~URLLoaderFactoryGetter(); 54 CONTENT_EXPORT ~URLLoaderFactoryGetter();
51 void InitializeOnIOThread( 55 void InitializeOnIOThread(
52 mojom::URLLoaderFactoryPtrInfo network_factory, 56 mojom::URLLoaderFactoryPtrInfo network_factory,
57 mojom::URLLoaderFactoryPtrInfo blob_factory,
53 scoped_refptr<ChromeAppCacheService> appcache_service); 58 scoped_refptr<ChromeAppCacheService> appcache_service);
54 void SetTestNetworkFactoryOnIOThread( 59 void SetTestNetworkFactoryOnIOThread(
55 mojom::URLLoaderFactoryPtrInfo test_factory); 60 mojom::URLLoaderFactoryPtrInfo test_factory);
56 61
57 // Only accessed on IO thread. 62 // Only accessed on IO thread.
58 mojom::URLLoaderFactoryPtr network_factory_; 63 mojom::URLLoaderFactoryPtr network_factory_;
64 mojom::URLLoaderFactoryPtr appcache_factory_;
65 mojom::URLLoaderFactoryPtr blob_factory_;
59 mojom::URLLoaderFactoryPtr test_factory_; 66 mojom::URLLoaderFactoryPtr test_factory_;
60 mojom::URLLoaderFactoryPtr appcache_factory_;
61 67
62 DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryGetter); 68 DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryGetter);
63 }; 69 };
64 70
65 } // namespace content 71 } // namespace content
66 72
67 #endif // CONTENT_BROWSER_URL_LOADER_FACTORY_GETTER_H_ 73 #endif // CONTENT_BROWSER_URL_LOADER_FACTORY_GETTER_H_
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl.cc ('k') | content/browser/url_loader_factory_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698