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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 const GetUserDataCallback& callback) { | 666 const GetUserDataCallback& callback) { |
667 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 667 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
668 if (!context_core_) { | 668 if (!context_core_) { |
669 RunSoon(base::Bind(callback, std::vector<std::string>(), | 669 RunSoon(base::Bind(callback, std::vector<std::string>(), |
670 SERVICE_WORKER_ERROR_ABORT)); | 670 SERVICE_WORKER_ERROR_ABORT)); |
671 return; | 671 return; |
672 } | 672 } |
673 context_core_->storage()->GetUserData(registration_id, keys, callback); | 673 context_core_->storage()->GetUserData(registration_id, keys, callback); |
674 } | 674 } |
675 | 675 |
676 void ServiceWorkerContextWrapper::GetRegistrationUserDataByKeyPrefix( | |
677 int64_t registration_id, | |
678 const std::string& key_prefix, | |
679 const GetUserDataCallback& callback) { | |
680 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
681 if (!context_core_) { | |
682 RunSoon(base::Bind(callback, std::vector<std::string>(), | |
683 SERVICE_WORKER_ERROR_ABORT)); | |
684 return; | |
685 } | |
686 context_core_->storage()->GetUserDataByKeyPrefix(registration_id, key_prefix, | |
687 callback); | |
688 } | |
689 | |
690 void ServiceWorkerContextWrapper::StoreRegistrationUserData( | 676 void ServiceWorkerContextWrapper::StoreRegistrationUserData( |
691 int64_t registration_id, | 677 int64_t registration_id, |
692 const GURL& origin, | 678 const GURL& origin, |
693 const std::vector<std::pair<std::string, std::string>>& key_value_pairs, | 679 const std::vector<std::pair<std::string, std::string>>& key_value_pairs, |
694 const StatusCallback& callback) { | 680 const StatusCallback& callback) { |
695 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 681 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
696 if (!context_core_) { | 682 if (!context_core_) { |
697 RunSoon(base::Bind(callback, SERVICE_WORKER_ERROR_ABORT)); | 683 RunSoon(base::Bind(callback, SERVICE_WORKER_ERROR_ABORT)); |
698 return; | 684 return; |
699 } | 685 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 service_worker_provider_id, | 808 service_worker_provider_id, |
823 std::move(client_ptr_info)); | 809 std::move(client_ptr_info)); |
824 } | 810 } |
825 | 811 |
826 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 812 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
827 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 813 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
828 return context_core_.get(); | 814 return context_core_.get(); |
829 } | 815 } |
830 | 816 |
831 } // namespace content | 817 } // namespace content |
OLD | NEW |