| 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 partition->platform_notification_context_->Initialize(); | 490 partition->platform_notification_context_->Initialize(); |
| 491 | 491 |
| 492 partition->background_sync_context_ = new BackgroundSyncContext(); | 492 partition->background_sync_context_ = new BackgroundSyncContext(); |
| 493 partition->background_sync_context_->Init(partition->service_worker_context_); | 493 partition->background_sync_context_->Init(partition->service_worker_context_); |
| 494 | 494 |
| 495 partition->payment_app_context_ = new PaymentAppContextImpl(); | 495 partition->payment_app_context_ = new PaymentAppContextImpl(); |
| 496 partition->payment_app_context_->Init(partition->service_worker_context_); | 496 partition->payment_app_context_->Init(partition->service_worker_context_); |
| 497 | 497 |
| 498 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); | 498 partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); |
| 499 | 499 |
| 500 partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); |
| 501 |
| 500 return partition; | 502 return partition; |
| 501 } | 503 } |
| 502 | 504 |
| 503 base::FilePath StoragePartitionImpl::GetPath() { | 505 base::FilePath StoragePartitionImpl::GetPath() { |
| 504 return partition_path_; | 506 return partition_path_; |
| 505 } | 507 } |
| 506 | 508 |
| 507 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { | 509 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { |
| 508 return url_request_context_.get(); | 510 return url_request_context_.get(); |
| 509 } | 511 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 } | 571 } |
| 570 | 572 |
| 571 PaymentAppContextImpl* StoragePartitionImpl::GetPaymentAppContext() { | 573 PaymentAppContextImpl* StoragePartitionImpl::GetPaymentAppContext() { |
| 572 return payment_app_context_.get(); | 574 return payment_app_context_.get(); |
| 573 } | 575 } |
| 574 | 576 |
| 575 BroadcastChannelProvider* StoragePartitionImpl::GetBroadcastChannelProvider() { | 577 BroadcastChannelProvider* StoragePartitionImpl::GetBroadcastChannelProvider() { |
| 576 return broadcast_channel_provider_.get(); | 578 return broadcast_channel_provider_.get(); |
| 577 } | 579 } |
| 578 | 580 |
| 581 BluetoothAllowedDevicesMap* |
| 582 StoragePartitionImpl::GetBluetoothAllowedDevicesMap() { |
| 583 return bluetooth_allowed_devices_map_.get(); |
| 584 } |
| 585 |
| 579 void StoragePartitionImpl::OpenLocalStorage( | 586 void StoragePartitionImpl::OpenLocalStorage( |
| 580 const url::Origin& origin, | 587 const url::Origin& origin, |
| 581 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) { | 588 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) { |
| 582 dom_storage_context_->OpenLocalStorage(origin, std::move(request)); | 589 dom_storage_context_->OpenLocalStorage(origin, std::move(request)); |
| 583 } | 590 } |
| 584 | 591 |
| 585 void StoragePartitionImpl::ClearDataImpl( | 592 void StoragePartitionImpl::ClearDataImpl( |
| 586 uint32_t remove_mask, | 593 uint32_t remove_mask, |
| 587 uint32_t quota_storage_remove_mask, | 594 uint32_t quota_storage_remove_mask, |
| 588 const GURL& storage_origin, | 595 const GURL& storage_origin, |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), origin_matcher, | 866 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), origin_matcher, |
| 860 cookie_matcher, GetURLRequestContext(), begin, end, callback); | 867 cookie_matcher, GetURLRequestContext(), begin, end, callback); |
| 861 } | 868 } |
| 862 | 869 |
| 863 void StoragePartitionImpl::Flush() { | 870 void StoragePartitionImpl::Flush() { |
| 864 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 871 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 865 if (GetDOMStorageContext()) | 872 if (GetDOMStorageContext()) |
| 866 GetDOMStorageContext()->Flush(); | 873 GetDOMStorageContext()->Flush(); |
| 867 } | 874 } |
| 868 | 875 |
| 876 void StoragePartitionImpl::ClearBluetoothAllowedDevicesMapForTesting() { |
| 877 bluetooth_allowed_devices_map_->Clear(); |
| 878 } |
| 879 |
| 869 BrowserContext* StoragePartitionImpl::browser_context() const { | 880 BrowserContext* StoragePartitionImpl::browser_context() const { |
| 870 return browser_context_; | 881 return browser_context_; |
| 871 } | 882 } |
| 872 | 883 |
| 873 void StoragePartitionImpl::Bind( | 884 void StoragePartitionImpl::Bind( |
| 874 mojo::InterfaceRequest<mojom::StoragePartitionService> request) { | 885 mojo::InterfaceRequest<mojom::StoragePartitionService> request) { |
| 875 bindings_.AddBinding(this, std::move(request)); | 886 bindings_.AddBinding(this, std::move(request)); |
| 876 } | 887 } |
| 877 | 888 |
| 878 void StoragePartitionImpl::OverrideQuotaManagerForTesting( | 889 void StoragePartitionImpl::OverrideQuotaManagerForTesting( |
| (...skipping 16 matching lines...) Expand all Loading... |
| 895 media_url_request_context_ = media_url_request_context; | 906 media_url_request_context_ = media_url_request_context; |
| 896 } | 907 } |
| 897 | 908 |
| 898 void StoragePartitionImpl::GetQuotaSettings( | 909 void StoragePartitionImpl::GetQuotaSettings( |
| 899 const storage::OptionalQuotaSettingsCallback& callback) { | 910 const storage::OptionalQuotaSettingsCallback& callback) { |
| 900 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, | 911 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, |
| 901 callback); | 912 callback); |
| 902 } | 913 } |
| 903 | 914 |
| 904 } // namespace content | 915 } // namespace content |
| OLD | NEW |