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 13 matching lines...) Expand all Loading... |
24 #include "content/browser/fileapi/browser_file_system_helper.h" | 24 #include "content/browser/fileapi/browser_file_system_helper.h" |
25 #include "content/browser/gpu/shader_cache_factory.h" | 25 #include "content/browser/gpu/shader_cache_factory.h" |
26 #include "content/browser/notifications/platform_notification_context_impl.h" | 26 #include "content/browser/notifications/platform_notification_context_impl.h" |
27 #include "content/common/dom_storage/dom_storage_types.h" | 27 #include "content/common/dom_storage/dom_storage_types.h" |
28 #include "content/public/browser/browser_context.h" | 28 #include "content/public/browser/browser_context.h" |
29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
30 #include "content/public/browser/content_browser_client.h" | 30 #include "content/public/browser/content_browser_client.h" |
31 #include "content/public/browser/dom_storage_context.h" | 31 #include "content/public/browser/dom_storage_context.h" |
32 #include "content/public/browser/indexed_db_context.h" | 32 #include "content/public/browser/indexed_db_context.h" |
33 #include "content/public/browser/local_storage_usage_info.h" | 33 #include "content/public/browser/local_storage_usage_info.h" |
| 34 #include "content/public/browser/network_service_instance.h" |
34 #include "content/public/browser/session_storage_usage_info.h" | 35 #include "content/public/browser/session_storage_usage_info.h" |
35 #include "content/public/common/content_client.h" | 36 #include "content/public/common/content_client.h" |
36 #include "content/public/common/content_features.h" | 37 #include "content/public/common/content_features.h" |
37 #include "content/public/common/content_switches.h" | 38 #include "content/public/common/content_switches.h" |
38 #include "content/public/common/service_manager_connection.h" | |
39 #include "content/public/common/service_names.mojom.h" | |
40 #include "net/base/completion_callback.h" | 39 #include "net/base/completion_callback.h" |
41 #include "net/base/net_errors.h" | 40 #include "net/base/net_errors.h" |
42 #include "net/cookies/canonical_cookie.h" | 41 #include "net/cookies/canonical_cookie.h" |
43 #include "net/cookies/cookie_monster.h" | 42 #include "net/cookies/cookie_monster.h" |
44 #include "net/url_request/url_request_context.h" | 43 #include "net/url_request/url_request_context.h" |
45 #include "net/url_request/url_request_context_getter.h" | 44 #include "net/url_request/url_request_context_getter.h" |
46 #include "ppapi/features/features.h" | 45 #include "ppapi/features/features.h" |
47 #include "services/service_manager/public/cpp/connector.h" | 46 #include "services/service_manager/public/cpp/connector.h" |
48 #include "storage/browser/blob/blob_registry_impl.h" | 47 #include "storage/browser/blob/blob_registry_impl.h" |
49 #include "storage/browser/blob/blob_storage_context.h" | 48 #include "storage/browser/blob/blob_storage_context.h" |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 partition->payment_app_context_->Init(partition->service_worker_context_); | 524 partition->payment_app_context_->Init(partition->service_worker_context_); |
526 | 525 |
527 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); | 526 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); |
528 | 527 |
529 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); | 528 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); |
530 | 529 |
531 scoped_refptr<ChromeBlobStorageContext> blob_context = | 530 scoped_refptr<ChromeBlobStorageContext> blob_context = |
532 ChromeBlobStorageContext::GetFor(context); | 531 ChromeBlobStorageContext::GetFor(context); |
533 | 532 |
534 if (base::FeatureList::IsEnabled(features::kNetworkService)) { | 533 if (base::FeatureList::IsEnabled(features::kNetworkService)) { |
535 static mojom::NetworkServicePtr* g_network_service = | |
536 new mojom::NetworkServicePtr; | |
537 if (!g_network_service->is_bound()) { | |
538 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( | |
539 mojom::kNetworkServiceName, g_network_service); | |
540 } | |
541 mojom::NetworkContextParamsPtr context_params = | 534 mojom::NetworkContextParamsPtr context_params = |
542 mojom::NetworkContextParams::New(); | 535 mojom::NetworkContextParams::New(); |
543 // TODO: fill this | 536 // TODO: fill this |
544 // context_params->cache_dir = | 537 // context_params->cache_dir = |
545 // context_params->cookie_path = | 538 // context_params->cookie_path = |
546 (*g_network_service) | 539 GetNetworkService()->CreateNetworkContext( |
547 ->CreateNetworkContext(MakeRequest(&partition->network_context_), | 540 MakeRequest(&partition->network_context_), std::move(context_params)); |
548 std::move(context_params)); | |
549 | 541 |
550 BlobURLLoaderFactory::BlobContextGetter blob_getter = | 542 BlobURLLoaderFactory::BlobContextGetter blob_getter = |
551 base::BindOnce(&BlobStorageContextGetter, blob_context); | 543 base::BindOnce(&BlobStorageContextGetter, blob_context); |
552 partition->blob_url_loader_factory_ = BlobURLLoaderFactory::Create( | 544 partition->blob_url_loader_factory_ = BlobURLLoaderFactory::Create( |
553 std::move(blob_getter), partition->filesystem_context_); | 545 std::move(blob_getter), partition->filesystem_context_); |
554 | 546 |
555 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter(); | 547 partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter(); |
556 partition->url_loader_factory_getter_->Initialize(partition.get()); | 548 partition->url_loader_factory_getter_->Initialize(partition.get()); |
557 } | 549 } |
558 | 550 |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 media_url_request_context_ = media_url_request_context; | 994 media_url_request_context_ = media_url_request_context; |
1003 } | 995 } |
1004 | 996 |
1005 void StoragePartitionImpl::GetQuotaSettings( | 997 void StoragePartitionImpl::GetQuotaSettings( |
1006 storage::OptionalQuotaSettingsCallback callback) { | 998 storage::OptionalQuotaSettingsCallback callback) { |
1007 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, | 999 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, |
1008 std::move(callback)); | 1000 std::move(callback)); |
1009 } | 1001 } |
1010 | 1002 |
1011 } // namespace content | 1003 } // namespace content |
OLD | NEW |