| 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/blob_storage/blob_url_loader_factory.h" | 5 #include "content/browser/blob_storage/blob_url_loader_factory.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 BlobContextGetter blob_storage_context_getter, | 352 BlobContextGetter blob_storage_context_getter, |
| 353 scoped_refptr<storage::FileSystemContext> file_system_context) | 353 scoped_refptr<storage::FileSystemContext> file_system_context) |
| 354 : file_system_context_(file_system_context) { | 354 : file_system_context_(file_system_context) { |
| 355 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 355 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 356 BrowserThread::PostTask( | 356 BrowserThread::PostTask( |
| 357 BrowserThread::IO, FROM_HERE, | 357 BrowserThread::IO, FROM_HERE, |
| 358 base::BindOnce(&BlobURLLoaderFactory::InitializeOnIO, this, | 358 base::BindOnce(&BlobURLLoaderFactory::InitializeOnIO, this, |
| 359 std::move(blob_storage_context_getter))); | 359 std::move(blob_storage_context_getter))); |
| 360 } | 360 } |
| 361 | 361 |
| 362 mojom::URLLoaderFactoryPtr BlobURLLoaderFactory::CreateFactory() { | 362 void BlobURLLoaderFactory::HandleRequest( |
| 363 mojom::URLLoaderFactoryRequest request) { |
| 363 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 364 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 364 mojom::URLLoaderFactoryPtr factory; | |
| 365 mojom::URLLoaderFactoryRequest request = mojo::MakeRequest(&factory); | |
| 366 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 365 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 367 base::BindOnce(&BlobURLLoaderFactory::BindOnIO, this, | 366 base::BindOnce(&BlobURLLoaderFactory::BindOnIO, this, |
| 368 std::move(request))); | 367 std::move(request))); |
| 369 | |
| 370 return factory; | |
| 371 } | 368 } |
| 372 | 369 |
| 373 BlobURLLoaderFactory::~BlobURLLoaderFactory() {} | 370 BlobURLLoaderFactory::~BlobURLLoaderFactory() {} |
| 374 | 371 |
| 375 void BlobURLLoaderFactory::InitializeOnIO( | 372 void BlobURLLoaderFactory::InitializeOnIO( |
| 376 BlobContextGetter blob_storage_context_getter) { | 373 BlobContextGetter blob_storage_context_getter) { |
| 377 blob_storage_context_ = std::move(blob_storage_context_getter).Run(); | 374 blob_storage_context_ = std::move(blob_storage_context_getter).Run(); |
| 378 } | 375 } |
| 379 | 376 |
| 380 void BlobURLLoaderFactory::BindOnIO(mojom::URLLoaderFactoryRequest request) { | 377 void BlobURLLoaderFactory::BindOnIO(mojom::URLLoaderFactoryRequest request) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 396 } | 393 } |
| 397 | 394 |
| 398 void BlobURLLoaderFactory::SyncLoad(int32_t routing_id, | 395 void BlobURLLoaderFactory::SyncLoad(int32_t routing_id, |
| 399 int32_t request_id, | 396 int32_t request_id, |
| 400 const ResourceRequest& request, | 397 const ResourceRequest& request, |
| 401 SyncLoadCallback callback) { | 398 SyncLoadCallback callback) { |
| 402 NOTREACHED(); | 399 NOTREACHED(); |
| 403 } | 400 } |
| 404 | 401 |
| 405 } // namespace content | 402 } // namespace content |
| OLD | NEW |