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

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

Issue 2936623002: Implement dumb URLLoader{Factory} for ServiceWorker script loading (for try)
Patch Set: . 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/storage_partition_impl.h" 5 #include "content/browser/storage_partition_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 489
490 base::FilePath path = in_memory ? base::FilePath() : partition_path; 490 base::FilePath path = in_memory ? base::FilePath() : partition_path;
491 partition->indexed_db_context_ = 491 partition->indexed_db_context_ =
492 new IndexedDBContextImpl(path, context->GetSpecialStoragePolicy(), 492 new IndexedDBContextImpl(path, context->GetSpecialStoragePolicy(),
493 quota_manager_proxy.get(), idb_task_runner); 493 quota_manager_proxy.get(), idb_task_runner);
494 494
495 partition->cache_storage_context_ = new CacheStorageContextImpl(context); 495 partition->cache_storage_context_ = new CacheStorageContextImpl(context);
496 partition->cache_storage_context_->Init(path, quota_manager_proxy); 496 partition->cache_storage_context_->Init(path, quota_manager_proxy);
497 497
498 partition->service_worker_context_ = new ServiceWorkerContextWrapper(context); 498 partition->service_worker_context_ = new ServiceWorkerContextWrapper(context);
499 partition->service_worker_context_->Init(path, quota_manager_proxy.get(),
500 context->GetSpecialStoragePolicy());
501 partition->service_worker_context_->set_storage_partition(partition.get()); 499 partition->service_worker_context_->set_storage_partition(partition.get());
502 500
503 partition->appcache_service_ = 501 partition->appcache_service_ =
504 new ChromeAppCacheService(quota_manager_proxy.get()); 502 new ChromeAppCacheService(quota_manager_proxy.get());
505 503
506 partition->push_messaging_context_ = 504 partition->push_messaging_context_ =
507 new PushMessagingContext(context, partition->service_worker_context_); 505 new PushMessagingContext(context, partition->service_worker_context_);
508 506
509 #if !defined(OS_ANDROID) 507 #if !defined(OS_ANDROID)
510 partition->host_zoom_level_context_ = new HostZoomLevelContext( 508 partition->host_zoom_level_context_ = new HostZoomLevelContext(
(...skipping 11 matching lines...) Expand all
522 partition->background_sync_context_ = new BackgroundSyncContext(); 520 partition->background_sync_context_ = new BackgroundSyncContext();
523 partition->background_sync_context_->Init(partition->service_worker_context_); 521 partition->background_sync_context_->Init(partition->service_worker_context_);
524 522
525 partition->payment_app_context_ = new PaymentAppContextImpl(); 523 partition->payment_app_context_ = new PaymentAppContextImpl();
526 partition->payment_app_context_->Init(partition->service_worker_context_); 524 partition->payment_app_context_->Init(partition->service_worker_context_);
527 525
528 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); 526 partition->broadcast_channel_provider_ = new BroadcastChannelProvider();
529 527
530 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); 528 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap();
531 529
530 scoped_refptr<ChromeBlobStorageContext> blob_context =
531 ChromeBlobStorageContext::GetFor(context);
532
532 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 533 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
533 switches::kEnableNetworkService)) { 534 switches::kEnableNetworkService)) {
534 mojom::NetworkServicePtr network_service; 535 mojom::NetworkServicePtr network_service;
535 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( 536 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface(
536 mojom::kNetworkServiceName, &network_service); 537 mojom::kNetworkServiceName, &network_service);
537 mojom::NetworkContextParamsPtr context_params = 538 mojom::NetworkContextParamsPtr context_params =
538 mojom::NetworkContextParams::New(); 539 mojom::NetworkContextParams::New();
539 // TODO: fill this 540 // TODO: fill this
540 // context_params->cache_dir = 541 // context_params->cache_dir =
541 // context_params->cookie_path = 542 // context_params->cookie_path =
542 network_service->CreateNetworkContext( 543 network_service->CreateNetworkContext(
543 MakeRequest(&partition->network_context_), std::move(context_params)); 544 MakeRequest(&partition->network_context_), std::move(context_params));
544 545
545 scoped_refptr<ChromeBlobStorageContext> blob_context =
546 ChromeBlobStorageContext::GetFor(context);
547 BlobURLLoaderFactory::BlobContextGetter blob_getter = 546 BlobURLLoaderFactory::BlobContextGetter blob_getter =
548 base::BindOnce(&BlobStorageContextGetter, blob_context); 547 base::BindOnce(&BlobStorageContextGetter, blob_context);
549 partition->blob_url_loader_factory_ = new BlobURLLoaderFactory( 548 partition->blob_url_loader_factory_ = new BlobURLLoaderFactory(
550 std::move(blob_getter), partition->filesystem_context_); 549 std::move(blob_getter), partition->filesystem_context_);
551 550
552 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter(); 551 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter();
553 partition->url_loader_factory_getter_->Initialize(partition.get()); 552 partition->url_loader_factory_getter_->Initialize(partition.get());
554 } 553 }
555 554
555 partition->service_worker_context_->Init(
556 path, quota_manager_proxy.get(), context->GetSpecialStoragePolicy(),
557 blob_context.get(), partition->url_loader_factory_getter_.get());
558
556 return partition; 559 return partition;
557 } 560 }
558 561
559 base::FilePath StoragePartitionImpl::GetPath() { 562 base::FilePath StoragePartitionImpl::GetPath() {
560 return partition_path_; 563 return partition_path_;
561 } 564 }
562 565
563 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { 566 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() {
564 return url_request_context_.get(); 567 return url_request_context_.get();
565 } 568 }
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 media_url_request_context_ = media_url_request_context; 989 media_url_request_context_ = media_url_request_context;
987 } 990 }
988 991
989 void StoragePartitionImpl::GetQuotaSettings( 992 void StoragePartitionImpl::GetQuotaSettings(
990 const storage::OptionalQuotaSettingsCallback& callback) { 993 const storage::OptionalQuotaSettingsCallback& callback) {
991 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, 994 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this,
992 callback); 995 callback);
993 } 996 }
994 997
995 } // namespace content 998 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698