| 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> |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 storage::FileSystemContext* filesystem_context, | 363 storage::FileSystemContext* filesystem_context, |
| 364 storage::DatabaseTracker* database_tracker, | 364 storage::DatabaseTracker* database_tracker, |
| 365 DOMStorageContextWrapper* dom_storage_context, | 365 DOMStorageContextWrapper* dom_storage_context, |
| 366 IndexedDBContextImpl* indexed_db_context, | 366 IndexedDBContextImpl* indexed_db_context, |
| 367 CacheStorageContextImpl* cache_storage_context, | 367 CacheStorageContextImpl* cache_storage_context, |
| 368 ServiceWorkerContextWrapper* service_worker_context, | 368 ServiceWorkerContextWrapper* service_worker_context, |
| 369 WebRTCIdentityStore* webrtc_identity_store, | 369 WebRTCIdentityStore* webrtc_identity_store, |
| 370 storage::SpecialStoragePolicy* special_storage_policy, | 370 storage::SpecialStoragePolicy* special_storage_policy, |
| 371 HostZoomLevelContext* host_zoom_level_context, | 371 HostZoomLevelContext* host_zoom_level_context, |
| 372 PlatformNotificationContextImpl* platform_notification_context, | 372 PlatformNotificationContextImpl* platform_notification_context, |
| 373 BackgroundSyncContext* background_sync_context) | 373 BackgroundSyncContext* background_sync_context, |
| 374 webmessaging::BroadcastChannelService* broadcast_channel_service) |
| 374 : partition_path_(partition_path), | 375 : partition_path_(partition_path), |
| 375 quota_manager_(quota_manager), | 376 quota_manager_(quota_manager), |
| 376 appcache_service_(appcache_service), | 377 appcache_service_(appcache_service), |
| 377 filesystem_context_(filesystem_context), | 378 filesystem_context_(filesystem_context), |
| 378 database_tracker_(database_tracker), | 379 database_tracker_(database_tracker), |
| 379 dom_storage_context_(dom_storage_context), | 380 dom_storage_context_(dom_storage_context), |
| 380 indexed_db_context_(indexed_db_context), | 381 indexed_db_context_(indexed_db_context), |
| 381 cache_storage_context_(cache_storage_context), | 382 cache_storage_context_(cache_storage_context), |
| 382 service_worker_context_(service_worker_context), | 383 service_worker_context_(service_worker_context), |
| 383 webrtc_identity_store_(webrtc_identity_store), | 384 webrtc_identity_store_(webrtc_identity_store), |
| 384 special_storage_policy_(special_storage_policy), | 385 special_storage_policy_(special_storage_policy), |
| 385 host_zoom_level_context_(host_zoom_level_context), | 386 host_zoom_level_context_(host_zoom_level_context), |
| 386 platform_notification_context_(platform_notification_context), | 387 platform_notification_context_(platform_notification_context), |
| 387 background_sync_context_(background_sync_context), | 388 background_sync_context_(background_sync_context), |
| 388 browser_context_(browser_context) { | 389 broadcast_channel_service_(broadcast_channel_service), |
| 389 } | 390 browser_context_(browser_context) {} |
| 390 | 391 |
| 391 StoragePartitionImpl::~StoragePartitionImpl() { | 392 StoragePartitionImpl::~StoragePartitionImpl() { |
| 392 browser_context_ = nullptr; | 393 browser_context_ = nullptr; |
| 393 | 394 |
| 394 // These message loop checks are just to avoid leaks in unittests. | 395 // These message loop checks are just to avoid leaks in unittests. |
| 395 if (GetDatabaseTracker() && | 396 if (GetDatabaseTracker() && |
| 396 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { | 397 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { |
| 397 BrowserThread::PostTask( | 398 BrowserThread::PostTask( |
| 398 BrowserThread::FILE, | 399 BrowserThread::FILE, |
| 399 FROM_HERE, | 400 FROM_HERE, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 506 |
| 506 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context = | 507 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context = |
| 507 new PlatformNotificationContextImpl(path, context, | 508 new PlatformNotificationContextImpl(path, context, |
| 508 service_worker_context); | 509 service_worker_context); |
| 509 platform_notification_context->Initialize(); | 510 platform_notification_context->Initialize(); |
| 510 | 511 |
| 511 scoped_refptr<BackgroundSyncContext> background_sync_context = | 512 scoped_refptr<BackgroundSyncContext> background_sync_context = |
| 512 new BackgroundSyncContext(); | 513 new BackgroundSyncContext(); |
| 513 background_sync_context->Init(service_worker_context); | 514 background_sync_context->Init(service_worker_context); |
| 514 | 515 |
| 516 scoped_refptr<webmessaging::BroadcastChannelService> |
| 517 broadcast_channel_service = new webmessaging::BroadcastChannelService(); |
| 518 |
| 515 StoragePartitionImpl* storage_partition = new StoragePartitionImpl( | 519 StoragePartitionImpl* storage_partition = new StoragePartitionImpl( |
| 516 context, partition_path, quota_manager.get(), appcache_service.get(), | 520 context, partition_path, quota_manager.get(), appcache_service.get(), |
| 517 filesystem_context.get(), database_tracker.get(), | 521 filesystem_context.get(), database_tracker.get(), |
| 518 dom_storage_context.get(), indexed_db_context.get(), | 522 dom_storage_context.get(), indexed_db_context.get(), |
| 519 cache_storage_context.get(), service_worker_context.get(), | 523 cache_storage_context.get(), service_worker_context.get(), |
| 520 webrtc_identity_store.get(), special_storage_policy.get(), | 524 webrtc_identity_store.get(), special_storage_policy.get(), |
| 521 host_zoom_level_context.get(), platform_notification_context.get(), | 525 host_zoom_level_context.get(), platform_notification_context.get(), |
| 522 background_sync_context.get()); | 526 background_sync_context.get(), broadcast_channel_service.get()); |
| 523 | 527 |
| 524 service_worker_context->set_storage_partition(storage_partition); | 528 service_worker_context->set_storage_partition(storage_partition); |
| 525 | 529 |
| 526 return storage_partition; | 530 return storage_partition; |
| 527 } | 531 } |
| 528 | 532 |
| 529 base::FilePath StoragePartitionImpl::GetPath() { | 533 base::FilePath StoragePartitionImpl::GetPath() { |
| 530 return partition_path_; | 534 return partition_path_; |
| 531 } | 535 } |
| 532 | 536 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 | 591 |
| 588 PlatformNotificationContextImpl* | 592 PlatformNotificationContextImpl* |
| 589 StoragePartitionImpl::GetPlatformNotificationContext() { | 593 StoragePartitionImpl::GetPlatformNotificationContext() { |
| 590 return platform_notification_context_.get(); | 594 return platform_notification_context_.get(); |
| 591 } | 595 } |
| 592 | 596 |
| 593 BackgroundSyncContext* StoragePartitionImpl::GetBackgroundSyncContext() { | 597 BackgroundSyncContext* StoragePartitionImpl::GetBackgroundSyncContext() { |
| 594 return background_sync_context_.get(); | 598 return background_sync_context_.get(); |
| 595 } | 599 } |
| 596 | 600 |
| 601 webmessaging::BroadcastChannelService* |
| 602 StoragePartitionImpl::GetBroadcastChannelService() { |
| 603 return broadcast_channel_service_.get(); |
| 604 } |
| 605 |
| 597 void StoragePartitionImpl::OpenLocalStorage( | 606 void StoragePartitionImpl::OpenLocalStorage( |
| 598 const url::Origin& origin, | 607 const url::Origin& origin, |
| 599 mojom::LevelDBObserverPtr observer, | 608 mojom::LevelDBObserverPtr observer, |
| 600 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) { | 609 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) { |
| 601 dom_storage_context_->OpenLocalStorage( | 610 dom_storage_context_->OpenLocalStorage( |
| 602 origin, std::move(observer), std::move(request)); | 611 origin, std::move(observer), std::move(request)); |
| 603 } | 612 } |
| 604 | 613 |
| 605 void StoragePartitionImpl::ClearDataImpl( | 614 void StoragePartitionImpl::ClearDataImpl( |
| 606 uint32_t remove_mask, | 615 uint32_t remove_mask, |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 net::URLRequestContextGetter* url_request_context) { | 924 net::URLRequestContextGetter* url_request_context) { |
| 916 url_request_context_ = url_request_context; | 925 url_request_context_ = url_request_context; |
| 917 } | 926 } |
| 918 | 927 |
| 919 void StoragePartitionImpl::SetMediaURLRequestContext( | 928 void StoragePartitionImpl::SetMediaURLRequestContext( |
| 920 net::URLRequestContextGetter* media_url_request_context) { | 929 net::URLRequestContextGetter* media_url_request_context) { |
| 921 media_url_request_context_ = media_url_request_context; | 930 media_url_request_context_ = media_url_request_context; |
| 922 } | 931 } |
| 923 | 932 |
| 924 } // namespace content | 933 } // namespace content |
| OLD | NEW |