| OLD | NEW |
| 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/storage_partition_impl.h" | 8 #include "content/browser/storage_partition_impl.h" |
| 9 #include "content/public/common/network_service.mojom.h" | 9 #include "content/public/common/network_service.mojom.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 URLLoaderFactoryGetter::URLLoaderFactoryGetter() {} | 13 URLLoaderFactoryGetter::URLLoaderFactoryGetter() {} |
| 14 | 14 |
| 15 void URLLoaderFactoryGetter::Initialize(StoragePartitionImpl* partition) { | 15 void URLLoaderFactoryGetter::Initialize(StoragePartitionImpl* partition) { |
| 16 mojom::URLLoaderFactoryPtr network_factory; | 16 mojom::URLLoaderFactoryPtr network_factory; |
| 17 partition->network_context()->CreateURLLoaderFactory( | 17 partition->GetNetworkContext()->CreateURLLoaderFactory( |
| 18 MakeRequest(&network_factory), 0); | 18 MakeRequest(&network_factory), 0); |
| 19 | 19 |
| 20 mojom::URLLoaderFactoryPtr blob_factory; | 20 mojom::URLLoaderFactoryPtr blob_factory; |
| 21 partition->GetBlobURLLoaderFactory()->HandleRequest( | 21 partition->GetBlobURLLoaderFactory()->HandleRequest( |
| 22 mojo::MakeRequest(&blob_factory)); | 22 mojo::MakeRequest(&blob_factory)); |
| 23 | 23 |
| 24 BrowserThread::PostTask( | 24 BrowserThread::PostTask( |
| 25 BrowserThread::IO, FROM_HERE, | 25 BrowserThread::IO, FROM_HERE, |
| 26 base::BindOnce(&URLLoaderFactoryGetter::InitializeOnIOThread, this, | 26 base::BindOnce(&URLLoaderFactoryGetter::InitializeOnIOThread, this, |
| 27 network_factory.PassInterface(), | 27 network_factory.PassInterface(), |
| (...skipping 29 matching lines...) Expand all Loading... |
| 57 network_factory_.Bind(std::move(network_factory)); | 57 network_factory_.Bind(std::move(network_factory)); |
| 58 blob_factory_.Bind(std::move(blob_factory)); | 58 blob_factory_.Bind(std::move(blob_factory)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void URLLoaderFactoryGetter::SetTestNetworkFactoryOnIOThread( | 61 void URLLoaderFactoryGetter::SetTestNetworkFactoryOnIOThread( |
| 62 mojom::URLLoaderFactoryPtrInfo test_factory) { | 62 mojom::URLLoaderFactoryPtrInfo test_factory) { |
| 63 test_factory_.Bind(std::move(test_factory)); | 63 test_factory_.Bind(std::move(test_factory)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace content | 66 } // namespace content |
| OLD | NEW |