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

Side by Side Diff: content/browser/blob_storage/blob_url_loader_factory.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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698