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

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

Issue 2976323002: Hook up ProfileIOData's URLRequestContext to a NetworkService. (Closed)
Patch Set: X11 is bonkers 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 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 12 matching lines...) Expand all
23 #include "content/browser/fileapi/browser_file_system_helper.h" 23 #include "content/browser/fileapi/browser_file_system_helper.h"
24 #include "content/browser/gpu/shader_cache_factory.h" 24 #include "content/browser/gpu/shader_cache_factory.h"
25 #include "content/browser/notifications/platform_notification_context_impl.h" 25 #include "content/browser/notifications/platform_notification_context_impl.h"
26 #include "content/common/dom_storage/dom_storage_types.h" 26 #include "content/common/dom_storage/dom_storage_types.h"
27 #include "content/public/browser/browser_context.h" 27 #include "content/public/browser/browser_context.h"
28 #include "content/public/browser/browser_thread.h" 28 #include "content/public/browser/browser_thread.h"
29 #include "content/public/browser/content_browser_client.h" 29 #include "content/public/browser/content_browser_client.h"
30 #include "content/public/browser/dom_storage_context.h" 30 #include "content/public/browser/dom_storage_context.h"
31 #include "content/public/browser/indexed_db_context.h" 31 #include "content/public/browser/indexed_db_context.h"
32 #include "content/public/browser/local_storage_usage_info.h" 32 #include "content/public/browser/local_storage_usage_info.h"
33 #include "content/public/browser/network_service_instance.h"
34 #include "content/public/browser/session_storage_usage_info.h" 33 #include "content/public/browser/session_storage_usage_info.h"
35 #include "content/public/common/content_client.h" 34 #include "content/public/common/content_client.h"
36 #include "content/public/common/content_features.h" 35 #include "content/public/common/content_features.h"
37 #include "content/public/common/content_switches.h" 36 #include "content/public/common/content_switches.h"
38 #include "net/base/completion_callback.h" 37 #include "net/base/completion_callback.h"
39 #include "net/base/net_errors.h" 38 #include "net/base/net_errors.h"
40 #include "net/cookies/canonical_cookie.h" 39 #include "net/cookies/canonical_cookie.h"
41 #include "net/cookies/cookie_monster.h" 40 #include "net/cookies/cookie_monster.h"
42 #include "net/url_request/url_request_context.h" 41 #include "net/url_request/url_request_context.h"
43 #include "net/url_request/url_request_context_getter.h" 42 #include "net/url_request/url_request_context_getter.h"
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 partition->payment_app_context_->Init(partition->service_worker_context_); 506 partition->payment_app_context_->Init(partition->service_worker_context_);
508 507
509 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); 508 partition->broadcast_channel_provider_ = new BroadcastChannelProvider();
510 509
511 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); 510 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap();
512 511
513 scoped_refptr<ChromeBlobStorageContext> blob_context = 512 scoped_refptr<ChromeBlobStorageContext> blob_context =
514 ChromeBlobStorageContext::GetFor(context); 513 ChromeBlobStorageContext::GetFor(context);
515 514
516 if (base::FeatureList::IsEnabled(features::kNetworkService)) { 515 if (base::FeatureList::IsEnabled(features::kNetworkService)) {
517 mojom::NetworkContextParamsPtr context_params = 516 if (relative_partition_path.empty()) {
518 mojom::NetworkContextParams::New(); 517 partition->network_context_ =
519 // TODO: fill this 518 GetContentClient()->browser()->CreateMainNetworkContext(context);
520 // context_params->cache_dir = 519 } else {
521 // context_params->cookie_path = 520 partition->network_context_ =
522 GetNetworkService()->CreateNetworkContext( 521 GetContentClient()
523 MakeRequest(&partition->network_context_), std::move(context_params)); 522 ->browser()
523 ->CreateNetworkContextForStoragePartition(context, in_memory,
524 partition_path);
525 }
524 526
525 BlobURLLoaderFactory::BlobContextGetter blob_getter = 527 BlobURLLoaderFactory::BlobContextGetter blob_getter =
526 base::BindOnce(&BlobStorageContextGetter, blob_context); 528 base::BindOnce(&BlobStorageContextGetter, blob_context);
527 partition->blob_url_loader_factory_ = BlobURLLoaderFactory::Create( 529 partition->blob_url_loader_factory_ = BlobURLLoaderFactory::Create(
528 std::move(blob_getter), partition->filesystem_context_); 530 std::move(blob_getter), partition->filesystem_context_);
529 531
530 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter(); 532 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter();
531 partition->url_loader_factory_getter_->Initialize(partition.get()); 533 partition->url_loader_factory_getter_->Initialize(partition.get());
532 } 534 }
533 535
(...skipping 15 matching lines...) Expand all
549 551
550 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { 552 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() {
551 return url_request_context_.get(); 553 return url_request_context_.get();
552 } 554 }
553 555
554 net::URLRequestContextGetter* 556 net::URLRequestContextGetter*
555 StoragePartitionImpl::GetMediaURLRequestContext() { 557 StoragePartitionImpl::GetMediaURLRequestContext() {
556 return media_url_request_context_.get(); 558 return media_url_request_context_.get();
557 } 559 }
558 560
561 mojom::NetworkContext* StoragePartitionImpl::GetNetworkContext() {
562 DCHECK(base::FeatureList::IsEnabled(features::kNetworkService));
563 return network_context_.get();
564 }
565
559 storage::QuotaManager* StoragePartitionImpl::GetQuotaManager() { 566 storage::QuotaManager* StoragePartitionImpl::GetQuotaManager() {
560 return quota_manager_.get(); 567 return quota_manager_.get();
561 } 568 }
562 569
563 ChromeAppCacheService* StoragePartitionImpl::GetAppCacheService() { 570 ChromeAppCacheService* StoragePartitionImpl::GetAppCacheService() {
564 return appcache_service_.get(); 571 return appcache_service_.get();
565 } 572 }
566 573
567 storage::FileSystemContext* StoragePartitionImpl::GetFileSystemContext() { 574 storage::FileSystemContext* StoragePartitionImpl::GetFileSystemContext() {
568 return filesystem_context_.get(); 575 return filesystem_context_.get();
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 media_url_request_context_ = media_url_request_context; 984 media_url_request_context_ = media_url_request_context;
978 } 985 }
979 986
980 void StoragePartitionImpl::GetQuotaSettings( 987 void StoragePartitionImpl::GetQuotaSettings(
981 storage::OptionalQuotaSettingsCallback callback) { 988 storage::OptionalQuotaSettingsCallback callback) {
982 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, 989 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this,
983 std::move(callback)); 990 std::move(callback));
984 } 991 }
985 992
986 } // namespace content 993 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698