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

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

Issue 2925903004: Add support for blob urls for subresources. (Closed)
Patch Set: review comment 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
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 #include "content/browser/url_loader_factory_getter.h" 5 #include "content/browser/url_loader_factory_getter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/appcache/appcache_url_loader_factory.h" 8 #include "content/browser/appcache/appcache_url_loader_factory.h"
9 #include "content/browser/storage_partition_impl.h" 9 #include "content/browser/storage_partition_impl.h"
10 #include "content/common/network_service.mojom.h" 10 #include "content/common/network_service.mojom.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 URLLoaderFactoryGetter::URLLoaderFactoryGetter() {} 14 URLLoaderFactoryGetter::URLLoaderFactoryGetter() {}
15 15
16 void URLLoaderFactoryGetter::Initialize(StoragePartitionImpl* partition) { 16 void URLLoaderFactoryGetter::Initialize(StoragePartitionImpl* partition) {
17 mojom::URLLoaderFactoryPtr network_factory; 17 mojom::URLLoaderFactoryPtr network_factory;
18 partition->network_context()->CreateURLLoaderFactory( 18 partition->network_context()->CreateURLLoaderFactory(
19 MakeRequest(&network_factory), 0); 19 MakeRequest(&network_factory), 0);
20 20
21 mojom::URLLoaderFactoryPtr blob_factory = 21 mojom::URLLoaderFactoryPtr blob_factory;
22 partition->GetBlobURLLoaderFactory()->CreateFactory(); 22 partition->GetBlobURLLoaderFactory()->HandleRequest(
23 mojo::MakeRequest(&blob_factory));
23 24
24 BrowserThread::PostTask( 25 BrowserThread::PostTask(
25 BrowserThread::IO, FROM_HERE, 26 BrowserThread::IO, FROM_HERE,
26 base::BindOnce(&URLLoaderFactoryGetter::InitializeOnIOThread, this, 27 base::BindOnce(&URLLoaderFactoryGetter::InitializeOnIOThread, this,
27 network_factory.PassInterface(), 28 network_factory.PassInterface(),
28 blob_factory.PassInterface(), 29 blob_factory.PassInterface(),
29 scoped_refptr<ChromeAppCacheService>( 30 scoped_refptr<ChromeAppCacheService>(
30 partition->GetAppCacheService()))); 31 partition->GetAppCacheService())));
31 } 32 }
32 33
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 AppCacheURLLoaderFactory::CreateURLLoaderFactory( 69 AppCacheURLLoaderFactory::CreateURLLoaderFactory(
69 mojo::MakeRequest(&appcache_factory_), appcache_service.get(), this); 70 mojo::MakeRequest(&appcache_factory_), appcache_service.get(), this);
70 } 71 }
71 72
72 void URLLoaderFactoryGetter::SetTestNetworkFactoryOnIOThread( 73 void URLLoaderFactoryGetter::SetTestNetworkFactoryOnIOThread(
73 mojom::URLLoaderFactoryPtrInfo test_factory) { 74 mojom::URLLoaderFactoryPtrInfo test_factory) {
74 test_factory_.Bind(std::move(test_factory)); 75 test_factory_.Bind(std::move(test_factory));
75 } 76 }
76 77
77 } // namespace content 78 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698