OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/service_worker/service_worker_context_wrapper.h" | 5 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 } | 667 } |
668 | 668 |
669 void ServiceWorkerContextWrapper::InitInternal( | 669 void ServiceWorkerContextWrapper::InitInternal( |
670 const base::FilePath& user_data_directory, | 670 const base::FilePath& user_data_directory, |
671 scoped_ptr<ServiceWorkerDatabaseTaskManager> database_task_manager, | 671 scoped_ptr<ServiceWorkerDatabaseTaskManager> database_task_manager, |
672 const scoped_refptr<base::SingleThreadTaskRunner>& disk_cache_thread, | 672 const scoped_refptr<base::SingleThreadTaskRunner>& disk_cache_thread, |
673 storage::QuotaManagerProxy* quota_manager_proxy, | 673 storage::QuotaManagerProxy* quota_manager_proxy, |
674 storage::SpecialStoragePolicy* special_storage_policy) { | 674 storage::SpecialStoragePolicy* special_storage_policy) { |
675 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 675 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
676 BrowserThread::PostTask( | 676 BrowserThread::PostTask( |
677 BrowserThread::IO, | 677 BrowserThread::IO, FROM_HERE, |
678 FROM_HERE, | 678 base::Bind(&ServiceWorkerContextWrapper::InitInternal, this, |
679 base::Bind(&ServiceWorkerContextWrapper::InitInternal, | 679 user_data_directory, base::Passed(&database_task_manager), |
680 this, | 680 disk_cache_thread, base::RetainedRef(quota_manager_proxy), |
681 user_data_directory, | 681 base::RetainedRef(special_storage_policy))); |
682 base::Passed(&database_task_manager), | |
683 disk_cache_thread, | |
684 make_scoped_refptr(quota_manager_proxy), | |
685 make_scoped_refptr(special_storage_policy))); | |
686 return; | 682 return; |
687 } | 683 } |
688 // TODO(pkasting): Remove ScopedTracker below once crbug.com/477117 is fixed. | 684 // TODO(pkasting): Remove ScopedTracker below once crbug.com/477117 is fixed. |
689 tracked_objects::ScopedTracker tracking_profile( | 685 tracked_objects::ScopedTracker tracking_profile( |
690 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 686 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
691 "477117 ServiceWorkerContextWrapper::InitInternal")); | 687 "477117 ServiceWorkerContextWrapper::InitInternal")); |
692 DCHECK(!context_core_); | 688 DCHECK(!context_core_); |
693 if (quota_manager_proxy) { | 689 if (quota_manager_proxy) { |
694 quota_manager_proxy->RegisterClient(new ServiceWorkerQuotaClient(this)); | 690 quota_manager_proxy->RegisterClient(new ServiceWorkerQuotaClient(this)); |
695 } | 691 } |
(...skipping 25 matching lines...) Expand all Loading... |
721 observer_list_->Notify(FROM_HERE, | 717 observer_list_->Notify(FROM_HERE, |
722 &ServiceWorkerContextObserver::OnStorageWiped); | 718 &ServiceWorkerContextObserver::OnStorageWiped); |
723 } | 719 } |
724 | 720 |
725 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 721 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
726 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 722 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
727 return context_core_.get(); | 723 return context_core_.get(); |
728 } | 724 } |
729 | 725 |
730 } // namespace content | 726 } // namespace content |
OLD | NEW |