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

Unified Diff: content/browser/url_loader_factory_getter.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/url_loader_factory_getter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/url_loader_factory_getter.cc
diff --git a/content/browser/url_loader_factory_getter.cc b/content/browser/url_loader_factory_getter.cc
index be9038340184bd980f2be19d987daf5bcc2833f2..611cef7d8a05d2a61ca52840ec0632e01e3b0c40 100644
--- a/content/browser/url_loader_factory_getter.cc
+++ b/content/browser/url_loader_factory_getter.cc
@@ -5,17 +5,25 @@
#include "content/browser/url_loader_factory_getter.h"
#include "base/bind.h"
+#include "content/browser/appcache/appcache_url_loader_factory.h"
+#include "content/browser/storage_partition_impl.h"
+#include "content/common/network_service.mojom.h"
namespace content {
URLLoaderFactoryGetter::URLLoaderFactoryGetter() {}
-void URLLoaderFactoryGetter::Initialize(
- mojom::URLLoaderFactoryPtr network_factory) {
+void URLLoaderFactoryGetter::Initialize(StoragePartitionImpl* partition) {
+ mojom::URLLoaderFactoryPtr network_factory;
+ partition->network_context()->CreateURLLoaderFactory(
+ MakeRequest(&network_factory), 0);
+
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::BindOnce(&URLLoaderFactoryGetter::InitializeOnIOThread, this,
- network_factory.PassInterface()));
+ network_factory.PassInterface(),
+ scoped_refptr<ChromeAppCacheService>(
+ partition->GetAppCacheService())));
}
mojom::URLLoaderFactoryPtr* URLLoaderFactoryGetter::GetNetworkFactory() {
@@ -34,11 +42,20 @@ void URLLoaderFactoryGetter::SetNetworkFactoryForTesting(
this, test_factory.PassInterface()));
}
+mojom::URLLoaderFactoryPtr* URLLoaderFactoryGetter::GetAppCacheFactory() {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ return &appcache_factory_;
+}
+
URLLoaderFactoryGetter::~URLLoaderFactoryGetter() {}
void URLLoaderFactoryGetter::InitializeOnIOThread(
- mojom::URLLoaderFactoryPtrInfo network_factory) {
+ mojom::URLLoaderFactoryPtrInfo network_factory,
+ scoped_refptr<ChromeAppCacheService> appcache_service) {
network_factory_.Bind(std::move(network_factory));
+
+ AppCacheURLLoaderFactory::CreateURLLoaderFactory(
+ mojo::MakeRequest(&appcache_factory_), appcache_service.get(), this);
}
void URLLoaderFactoryGetter::SetTestNetworkFactoryOnIOThread(
« no previous file with comments | « content/browser/url_loader_factory_getter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698