| 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/location.h" | 13 #include "base/location.h" |
| 14 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
| 15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "content/browser/browser_main_loop.h" | 17 #include "content/browser/browser_main_loop.h" |
| 18 #include "content/browser/browsing_data/storage_partition_http_cache_data_remove
r.h" | 18 #include "content/browser/browsing_data/storage_partition_http_cache_data_remove
r.h" |
| 19 #include "content/browser/fileapi/browser_file_system_helper.h" | 19 #include "content/browser/fileapi/browser_file_system_helper.h" |
| 20 #include "content/browser/gpu/shader_cache_factory.h" | 20 #include "content/browser/gpu/shader_cache_factory.h" |
| 21 #include "content/browser/host_zoom_map_impl.h" | |
| 22 #include "content/browser/notifications/platform_notification_context_impl.h" | 21 #include "content/browser/notifications/platform_notification_context_impl.h" |
| 23 #include "content/common/dom_storage/dom_storage_types.h" | 22 #include "content/common/dom_storage/dom_storage_types.h" |
| 24 #include "content/public/browser/browser_context.h" | 23 #include "content/public/browser/browser_context.h" |
| 25 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
| 26 #include "content/public/browser/content_browser_client.h" | 25 #include "content/public/browser/content_browser_client.h" |
| 27 #include "content/public/browser/dom_storage_context.h" | 26 #include "content/public/browser/dom_storage_context.h" |
| 28 #include "content/public/browser/indexed_db_context.h" | 27 #include "content/public/browser/indexed_db_context.h" |
| 29 #include "content/public/browser/local_storage_usage_info.h" | 28 #include "content/public/browser/local_storage_usage_info.h" |
| 30 #include "content/public/browser/session_storage_usage_info.h" | 29 #include "content/public/browser/session_storage_usage_info.h" |
| 31 #include "content/public/common/content_client.h" | 30 #include "content/public/common/content_client.h" |
| 32 #include "net/base/completion_callback.h" | 31 #include "net/base/completion_callback.h" |
| 33 #include "net/base/net_errors.h" | 32 #include "net/base/net_errors.h" |
| 34 #include "net/cookies/canonical_cookie.h" | 33 #include "net/cookies/canonical_cookie.h" |
| 35 #include "net/cookies/cookie_monster.h" | 34 #include "net/cookies/cookie_monster.h" |
| 36 #include "net/url_request/url_request_context.h" | 35 #include "net/url_request/url_request_context.h" |
| 37 #include "net/url_request/url_request_context_getter.h" | 36 #include "net/url_request/url_request_context_getter.h" |
| 38 #include "ppapi/features/features.h" | 37 #include "ppapi/features/features.h" |
| 39 #include "storage/browser/database/database_tracker.h" | 38 #include "storage/browser/database/database_tracker.h" |
| 40 #include "storage/browser/quota/quota_manager.h" | 39 #include "storage/browser/quota/quota_manager.h" |
| 41 | 40 |
| 41 #if !defined(OS_ANDROID) |
| 42 #include "content/browser/host_zoom_map_impl.h" |
| 43 #endif // !defined(OS_ANDROID) |
| 44 |
| 42 #if BUILDFLAG(ENABLE_PLUGINS) | 45 #if BUILDFLAG(ENABLE_PLUGINS) |
| 43 #include "content/browser/plugin_private_storage_helper.h" | 46 #include "content/browser/plugin_private_storage_helper.h" |
| 44 #endif // BUILDFLAG(ENABLE_PLUGINS) | 47 #endif // BUILDFLAG(ENABLE_PLUGINS) |
| 45 | 48 |
| 46 namespace content { | 49 namespace content { |
| 47 | 50 |
| 48 namespace { | 51 namespace { |
| 49 | 52 |
| 50 bool DoesCookieMatchHost(const std::string& host, | 53 bool DoesCookieMatchHost(const std::string& host, |
| 51 const net::CanonicalCookie& cookie) { | 54 const net::CanonicalCookie& cookie) { |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 partition->service_worker_context_->Init(path, quota_manager_proxy.get(), | 481 partition->service_worker_context_->Init(path, quota_manager_proxy.get(), |
| 479 context->GetSpecialStoragePolicy()); | 482 context->GetSpecialStoragePolicy()); |
| 480 partition->service_worker_context_->set_storage_partition(partition.get()); | 483 partition->service_worker_context_->set_storage_partition(partition.get()); |
| 481 | 484 |
| 482 partition->appcache_service_ = | 485 partition->appcache_service_ = |
| 483 new ChromeAppCacheService(quota_manager_proxy.get()); | 486 new ChromeAppCacheService(quota_manager_proxy.get()); |
| 484 | 487 |
| 485 partition->push_messaging_context_ = | 488 partition->push_messaging_context_ = |
| 486 new PushMessagingContext(context, partition->service_worker_context_); | 489 new PushMessagingContext(context, partition->service_worker_context_); |
| 487 | 490 |
| 491 #if !defined(OS_ANDROID) |
| 488 partition->host_zoom_level_context_ = new HostZoomLevelContext( | 492 partition->host_zoom_level_context_ = new HostZoomLevelContext( |
| 489 context->CreateZoomLevelDelegate(partition_path)); | 493 context->CreateZoomLevelDelegate(partition_path)); |
| 494 #endif // !defined(OS_ANDROID) |
| 490 | 495 |
| 491 partition->platform_notification_context_ = | 496 partition->platform_notification_context_ = |
| 492 new PlatformNotificationContextImpl(path, context, | 497 new PlatformNotificationContextImpl(path, context, |
| 493 partition->service_worker_context_); | 498 partition->service_worker_context_); |
| 494 partition->platform_notification_context_->Initialize(); | 499 partition->platform_notification_context_->Initialize(); |
| 495 | 500 |
| 496 partition->background_fetch_context_ = new BackgroundFetchContext( | 501 partition->background_fetch_context_ = new BackgroundFetchContext( |
| 497 context, partition.get(), partition->service_worker_context_); | 502 context, partition.get(), partition->service_worker_context_); |
| 498 | 503 |
| 499 partition->background_sync_context_ = new BackgroundSyncContext(); | 504 partition->background_sync_context_ = new BackgroundSyncContext(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 } | 552 } |
| 548 | 553 |
| 549 CacheStorageContextImpl* StoragePartitionImpl::GetCacheStorageContext() { | 554 CacheStorageContextImpl* StoragePartitionImpl::GetCacheStorageContext() { |
| 550 return cache_storage_context_.get(); | 555 return cache_storage_context_.get(); |
| 551 } | 556 } |
| 552 | 557 |
| 553 ServiceWorkerContextWrapper* StoragePartitionImpl::GetServiceWorkerContext() { | 558 ServiceWorkerContextWrapper* StoragePartitionImpl::GetServiceWorkerContext() { |
| 554 return service_worker_context_.get(); | 559 return service_worker_context_.get(); |
| 555 } | 560 } |
| 556 | 561 |
| 562 #if !defined(OS_ANDROID) |
| 557 HostZoomMap* StoragePartitionImpl::GetHostZoomMap() { | 563 HostZoomMap* StoragePartitionImpl::GetHostZoomMap() { |
| 558 DCHECK(host_zoom_level_context_.get()); | 564 DCHECK(host_zoom_level_context_.get()); |
| 559 return host_zoom_level_context_->GetHostZoomMap(); | 565 return host_zoom_level_context_->GetHostZoomMap(); |
| 560 } | 566 } |
| 561 | 567 |
| 562 HostZoomLevelContext* StoragePartitionImpl::GetHostZoomLevelContext() { | 568 HostZoomLevelContext* StoragePartitionImpl::GetHostZoomLevelContext() { |
| 563 return host_zoom_level_context_.get(); | 569 return host_zoom_level_context_.get(); |
| 564 } | 570 } |
| 565 | 571 |
| 566 ZoomLevelDelegate* StoragePartitionImpl::GetZoomLevelDelegate() { | 572 ZoomLevelDelegate* StoragePartitionImpl::GetZoomLevelDelegate() { |
| 567 DCHECK(host_zoom_level_context_.get()); | 573 DCHECK(host_zoom_level_context_.get()); |
| 568 return host_zoom_level_context_->GetZoomLevelDelegate(); | 574 return host_zoom_level_context_->GetZoomLevelDelegate(); |
| 569 } | 575 } |
| 576 #endif // !defined(OS_ANDROID) |
| 570 | 577 |
| 571 PlatformNotificationContextImpl* | 578 PlatformNotificationContextImpl* |
| 572 StoragePartitionImpl::GetPlatformNotificationContext() { | 579 StoragePartitionImpl::GetPlatformNotificationContext() { |
| 573 return platform_notification_context_.get(); | 580 return platform_notification_context_.get(); |
| 574 } | 581 } |
| 575 | 582 |
| 576 BackgroundFetchContext* StoragePartitionImpl::GetBackgroundFetchContext() { | 583 BackgroundFetchContext* StoragePartitionImpl::GetBackgroundFetchContext() { |
| 577 return background_fetch_context_.get(); | 584 return background_fetch_context_.get(); |
| 578 } | 585 } |
| 579 | 586 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 media_url_request_context_ = media_url_request_context; | 940 media_url_request_context_ = media_url_request_context; |
| 934 } | 941 } |
| 935 | 942 |
| 936 void StoragePartitionImpl::GetQuotaSettings( | 943 void StoragePartitionImpl::GetQuotaSettings( |
| 937 const storage::OptionalQuotaSettingsCallback& callback) { | 944 const storage::OptionalQuotaSettingsCallback& callback) { |
| 938 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, | 945 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, |
| 939 callback); | 946 callback); |
| 940 } | 947 } |
| 941 | 948 |
| 942 } // namespace content | 949 } // namespace content |
| OLD | NEW |