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

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

Issue 2959903002: Revert of Implement dumb URLLoader{Factory} for ServiceWorker script loading (Closed)
Patch Set: pull master and rebase Created 3 years, 5 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());
499 partition->service_worker_context_->set_storage_partition(partition.get()); 501 partition->service_worker_context_->set_storage_partition(partition.get());
500 502
501 partition->appcache_service_ = 503 partition->appcache_service_ =
502 new ChromeAppCacheService(quota_manager_proxy.get()); 504 new ChromeAppCacheService(quota_manager_proxy.get());
503 505
504 partition->push_messaging_context_ = 506 partition->push_messaging_context_ =
505 new PushMessagingContext(context, partition->service_worker_context_); 507 new PushMessagingContext(context, partition->service_worker_context_);
506 508
507 #if !defined(OS_ANDROID) 509 #if !defined(OS_ANDROID)
508 partition->host_zoom_level_context_ = new HostZoomLevelContext( 510 partition->host_zoom_level_context_ = new HostZoomLevelContext(
(...skipping 11 matching lines...) Expand all
520 partition->background_sync_context_ = new BackgroundSyncContext(); 522 partition->background_sync_context_ = new BackgroundSyncContext();
521 partition->background_sync_context_->Init(partition->service_worker_context_); 523 partition->background_sync_context_->Init(partition->service_worker_context_);
522 524
523 partition->payment_app_context_ = new PaymentAppContextImpl(); 525 partition->payment_app_context_ = new PaymentAppContextImpl();
524 partition->payment_app_context_->Init(partition->service_worker_context_); 526 partition->payment_app_context_->Init(partition->service_worker_context_);
525 527
526 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); 528 partition->broadcast_channel_provider_ = new BroadcastChannelProvider();
527 529
528 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); 530 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap();
529 531
530 scoped_refptr<ChromeBlobStorageContext> blob_context =
531 ChromeBlobStorageContext::GetFor(context);
532
533 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 532 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
534 switches::kEnableNetworkService)) { 533 switches::kEnableNetworkService)) {
535 mojom::NetworkServicePtr network_service; 534 mojom::NetworkServicePtr network_service;
536 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( 535 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface(
537 mojom::kNetworkServiceName, &network_service); 536 mojom::kNetworkServiceName, &network_service);
538 mojom::NetworkContextParamsPtr context_params = 537 mojom::NetworkContextParamsPtr context_params =
539 mojom::NetworkContextParams::New(); 538 mojom::NetworkContextParams::New();
540 // TODO: fill this 539 // TODO: fill this
541 // context_params->cache_dir = 540 // context_params->cache_dir =
542 // context_params->cookie_path = 541 // context_params->cookie_path =
543 network_service->CreateNetworkContext( 542 network_service->CreateNetworkContext(
544 MakeRequest(&partition->network_context_), std::move(context_params)); 543 MakeRequest(&partition->network_context_), std::move(context_params));
545 544
545 scoped_refptr<ChromeBlobStorageContext> blob_context =
546 ChromeBlobStorageContext::GetFor(context);
546 BlobURLLoaderFactory::BlobContextGetter blob_getter = 547 BlobURLLoaderFactory::BlobContextGetter blob_getter =
547 base::BindOnce(&BlobStorageContextGetter, blob_context); 548 base::BindOnce(&BlobStorageContextGetter, blob_context);
548 partition->blob_url_loader_factory_ = new BlobURLLoaderFactory( 549 partition->blob_url_loader_factory_ = new BlobURLLoaderFactory(
549 std::move(blob_getter), partition->filesystem_context_); 550 std::move(blob_getter), partition->filesystem_context_);
550 551
551 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter(); 552 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter();
552 partition->url_loader_factory_getter_->Initialize(partition.get()); 553 partition->url_loader_factory_getter_->Initialize(partition.get());
553 } 554 }
554 555
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
559 return partition; 556 return partition;
560 } 557 }
561 558
562 base::FilePath StoragePartitionImpl::GetPath() { 559 base::FilePath StoragePartitionImpl::GetPath() {
563 return partition_path_; 560 return partition_path_;
564 } 561 }
565 562
566 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { 563 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() {
567 return url_request_context_.get(); 564 return url_request_context_.get();
568 } 565 }
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 media_url_request_context_ = media_url_request_context; 986 media_url_request_context_ = media_url_request_context;
990 } 987 }
991 988
992 void StoragePartitionImpl::GetQuotaSettings( 989 void StoragePartitionImpl::GetQuotaSettings(
993 storage::OptionalQuotaSettingsCallback callback) { 990 storage::OptionalQuotaSettingsCallback callback) {
994 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, 991 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this,
995 std::move(callback)); 992 std::move(callback));
996 } 993 }
997 994
998 } // namespace content 995 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698