| 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 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/sequenced_task_runner.h" | 15 #include "base/sequenced_task_runner.h" |
| 16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
| 18 #include "content/browser/browser_main_loop.h" | 19 #include "content/browser/browser_main_loop.h" |
| 19 #include "content/browser/browsing_data/storage_partition_http_cache_data_remove
r.h" | 20 #include "content/browser/browsing_data/storage_partition_http_cache_data_remove
r.h" |
| 20 #include "content/browser/fileapi/browser_file_system_helper.h" | 21 #include "content/browser/fileapi/browser_file_system_helper.h" |
| 21 #include "content/browser/gpu/shader_cache_factory.h" | 22 #include "content/browser/gpu/shader_cache_factory.h" |
| 22 #include "content/browser/notifications/platform_notification_context_impl.h" | 23 #include "content/browser/notifications/platform_notification_context_impl.h" |
| 23 #include "content/common/dom_storage/dom_storage_types.h" | 24 #include "content/common/dom_storage/dom_storage_types.h" |
| 24 #include "content/public/browser/browser_context.h" | 25 #include "content/public/browser/browser_context.h" |
| 25 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 26 #include "content/public/browser/content_browser_client.h" | 27 #include "content/public/browser/content_browser_client.h" |
| 27 #include "content/public/browser/dom_storage_context.h" | 28 #include "content/public/browser/dom_storage_context.h" |
| 28 #include "content/public/browser/indexed_db_context.h" | 29 #include "content/public/browser/indexed_db_context.h" |
| 29 #include "content/public/browser/local_storage_usage_info.h" | 30 #include "content/public/browser/local_storage_usage_info.h" |
| 30 #include "content/public/browser/session_storage_usage_info.h" | 31 #include "content/public/browser/session_storage_usage_info.h" |
| 31 #include "content/public/common/content_client.h" | 32 #include "content/public/common/content_client.h" |
| 32 #include "content/public/common/content_switches.h" | 33 #include "content/public/common/content_switches.h" |
| 33 #include "content/public/common/service_manager_connection.h" | 34 #include "content/public/common/service_manager_connection.h" |
| 34 #include "content/public/common/service_names.mojom.h" | 35 #include "content/public/common/service_names.mojom.h" |
| 35 #include "net/base/completion_callback.h" | 36 #include "net/base/completion_callback.h" |
| 36 #include "net/base/net_errors.h" | 37 #include "net/base/net_errors.h" |
| 37 #include "net/cookies/canonical_cookie.h" | 38 #include "net/cookies/canonical_cookie.h" |
| 38 #include "net/cookies/cookie_monster.h" | 39 #include "net/cookies/cookie_monster.h" |
| 39 #include "net/url_request/url_request_context.h" | 40 #include "net/url_request/url_request_context.h" |
| 40 #include "net/url_request/url_request_context_getter.h" | 41 #include "net/url_request/url_request_context_getter.h" |
| 41 #include "ppapi/features/features.h" | 42 #include "ppapi/features/features.h" |
| 42 #include "services/service_manager/public/cpp/connector.h" | 43 #include "services/service_manager/public/cpp/connector.h" |
| 44 #include "storage/browser/blob/blob_storage_context.h" |
| 43 #include "storage/browser/database/database_tracker.h" | 45 #include "storage/browser/database/database_tracker.h" |
| 44 #include "storage/browser/quota/quota_manager.h" | 46 #include "storage/browser/quota/quota_manager.h" |
| 45 | 47 |
| 46 #if !defined(OS_ANDROID) | 48 #if !defined(OS_ANDROID) |
| 47 #include "content/browser/host_zoom_map_impl.h" | 49 #include "content/browser/host_zoom_map_impl.h" |
| 48 #endif // !defined(OS_ANDROID) | 50 #endif // !defined(OS_ANDROID) |
| 49 | 51 |
| 50 #if BUILDFLAG(ENABLE_PLUGINS) | 52 #if BUILDFLAG(ENABLE_PLUGINS) |
| 51 #include "content/browser/plugin_private_storage_helper.h" | 53 #include "content/browser/plugin_private_storage_helper.h" |
| 52 #endif // BUILDFLAG(ENABLE_PLUGINS) | 54 #endif // BUILDFLAG(ENABLE_PLUGINS) |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 partition->background_sync_context_ = new BackgroundSyncContext(); | 511 partition->background_sync_context_ = new BackgroundSyncContext(); |
| 510 partition->background_sync_context_->Init(partition->service_worker_context_); | 512 partition->background_sync_context_->Init(partition->service_worker_context_); |
| 511 | 513 |
| 512 partition->payment_app_context_ = new PaymentAppContextImpl(); | 514 partition->payment_app_context_ = new PaymentAppContextImpl(); |
| 513 partition->payment_app_context_->Init(partition->service_worker_context_); | 515 partition->payment_app_context_->Init(partition->service_worker_context_); |
| 514 | 516 |
| 515 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); | 517 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); |
| 516 | 518 |
| 517 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); | 519 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); |
| 518 | 520 |
| 521 partition->blob_url_loader_factory_ = new BlobURLLoaderFactory( |
| 522 ChromeBlobStorageContext::GetFor(context)->context()->AsWeakPtr(), |
| 523 partition->filesystem_context_); |
| 524 |
| 519 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 525 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 520 switches::kEnableNetworkService)) { | 526 switches::kEnableNetworkService)) { |
| 521 mojom::NetworkServicePtr network_service; | 527 mojom::NetworkServicePtr network_service; |
| 522 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( | 528 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( |
| 523 mojom::kNetworkServiceName, &network_service); | 529 mojom::kNetworkServiceName, &network_service); |
| 524 mojom::NetworkContextParamsPtr context_params = | 530 mojom::NetworkContextParamsPtr context_params = |
| 525 mojom::NetworkContextParams::New(); | 531 mojom::NetworkContextParams::New(); |
| 526 // TODO: fill this | 532 // TODO: fill this |
| 527 // context_params->cache_dir = | 533 // context_params->cache_dir = |
| 528 // context_params->cookie_path = | 534 // context_params->cookie_path = |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 | 622 |
| 617 BroadcastChannelProvider* StoragePartitionImpl::GetBroadcastChannelProvider() { | 623 BroadcastChannelProvider* StoragePartitionImpl::GetBroadcastChannelProvider() { |
| 618 return broadcast_channel_provider_.get(); | 624 return broadcast_channel_provider_.get(); |
| 619 } | 625 } |
| 620 | 626 |
| 621 BluetoothAllowedDevicesMap* | 627 BluetoothAllowedDevicesMap* |
| 622 StoragePartitionImpl::GetBluetoothAllowedDevicesMap() { | 628 StoragePartitionImpl::GetBluetoothAllowedDevicesMap() { |
| 623 return bluetooth_allowed_devices_map_.get(); | 629 return bluetooth_allowed_devices_map_.get(); |
| 624 } | 630 } |
| 625 | 631 |
| 632 BlobURLLoaderFactory* StoragePartitionImpl::GetBlobURLLoaderFactory() { |
| 633 return blob_url_loader_factory_.get(); |
| 634 } |
| 635 |
| 626 void StoragePartitionImpl::OpenLocalStorage( | 636 void StoragePartitionImpl::OpenLocalStorage( |
| 627 const url::Origin& origin, | 637 const url::Origin& origin, |
| 628 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) { | 638 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) { |
| 629 dom_storage_context_->OpenLocalStorage(origin, std::move(request)); | 639 dom_storage_context_->OpenLocalStorage(origin, std::move(request)); |
| 630 } | 640 } |
| 631 | 641 |
| 632 void StoragePartitionImpl::ClearDataImpl( | 642 void StoragePartitionImpl::ClearDataImpl( |
| 633 uint32_t remove_mask, | 643 uint32_t remove_mask, |
| 634 uint32_t quota_storage_remove_mask, | 644 uint32_t quota_storage_remove_mask, |
| 635 const GURL& storage_origin, | 645 const GURL& storage_origin, |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 media_url_request_context_ = media_url_request_context; | 972 media_url_request_context_ = media_url_request_context; |
| 963 } | 973 } |
| 964 | 974 |
| 965 void StoragePartitionImpl::GetQuotaSettings( | 975 void StoragePartitionImpl::GetQuotaSettings( |
| 966 const storage::OptionalQuotaSettingsCallback& callback) { | 976 const storage::OptionalQuotaSettingsCallback& callback) { |
| 967 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, | 977 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, |
| 968 callback); | 978 callback); |
| 969 } | 979 } |
| 970 | 980 |
| 971 } // namespace content | 981 } // namespace content |
| OLD | NEW |