OLD | NEW |
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 Loading... |
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 Loading... |
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 partition->network_context_ = |
518 mojom::NetworkContextParams::New(); | 517 GetContentClient()->browser()->CreateNetworkContext( |
519 // TODO: fill this | 518 context, in_memory, relative_partition_path); |
520 // context_params->cache_dir = | |
521 // context_params->cookie_path = | |
522 GetNetworkService()->CreateNetworkContext( | |
523 MakeRequest(&partition->network_context_), std::move(context_params)); | |
524 | 519 |
525 BlobURLLoaderFactory::BlobContextGetter blob_getter = | 520 BlobURLLoaderFactory::BlobContextGetter blob_getter = |
526 base::BindOnce(&BlobStorageContextGetter, blob_context); | 521 base::BindOnce(&BlobStorageContextGetter, blob_context); |
527 partition->blob_url_loader_factory_ = BlobURLLoaderFactory::Create( | 522 partition->blob_url_loader_factory_ = BlobURLLoaderFactory::Create( |
528 std::move(blob_getter), partition->filesystem_context_); | 523 std::move(blob_getter), partition->filesystem_context_); |
529 | 524 |
530 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter(); | 525 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter(); |
531 partition->url_loader_factory_getter_->Initialize(partition.get()); | 526 partition->url_loader_factory_getter_->Initialize(partition.get()); |
532 } | 527 } |
533 | 528 |
(...skipping 15 matching lines...) Expand all Loading... |
549 | 544 |
550 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { | 545 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { |
551 return url_request_context_.get(); | 546 return url_request_context_.get(); |
552 } | 547 } |
553 | 548 |
554 net::URLRequestContextGetter* | 549 net::URLRequestContextGetter* |
555 StoragePartitionImpl::GetMediaURLRequestContext() { | 550 StoragePartitionImpl::GetMediaURLRequestContext() { |
556 return media_url_request_context_.get(); | 551 return media_url_request_context_.get(); |
557 } | 552 } |
558 | 553 |
| 554 mojom::NetworkContext* StoragePartitionImpl::GetNetworkContext() { |
| 555 DCHECK(base::FeatureList::IsEnabled(features::kNetworkService)); |
| 556 return network_context_.get(); |
| 557 } |
| 558 |
559 storage::QuotaManager* StoragePartitionImpl::GetQuotaManager() { | 559 storage::QuotaManager* StoragePartitionImpl::GetQuotaManager() { |
560 return quota_manager_.get(); | 560 return quota_manager_.get(); |
561 } | 561 } |
562 | 562 |
563 ChromeAppCacheService* StoragePartitionImpl::GetAppCacheService() { | 563 ChromeAppCacheService* StoragePartitionImpl::GetAppCacheService() { |
564 return appcache_service_.get(); | 564 return appcache_service_.get(); |
565 } | 565 } |
566 | 566 |
567 storage::FileSystemContext* StoragePartitionImpl::GetFileSystemContext() { | 567 storage::FileSystemContext* StoragePartitionImpl::GetFileSystemContext() { |
568 return filesystem_context_.get(); | 568 return filesystem_context_.get(); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 media_url_request_context_ = media_url_request_context; | 977 media_url_request_context_ = media_url_request_context; |
978 } | 978 } |
979 | 979 |
980 void StoragePartitionImpl::GetQuotaSettings( | 980 void StoragePartitionImpl::GetQuotaSettings( |
981 storage::OptionalQuotaSettingsCallback callback) { | 981 storage::OptionalQuotaSettingsCallback callback) { |
982 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, | 982 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, |
983 std::move(callback)); | 983 std::move(callback)); |
984 } | 984 } |
985 | 985 |
986 } // namespace content | 986 } // namespace content |
OLD | NEW |