| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "modules/quota/WorkerNavigatorStorageQuota.h" | 32 #include "modules/quota/WorkerNavigatorStorageQuota.h" |
| 33 | 33 |
| 34 #include "modules/quota/DeprecatedStorageQuota.h" | 34 #include "modules/quota/DeprecatedStorageQuota.h" |
| 35 #include "modules/quota/StorageManager.h" |
| 35 | 36 |
| 36 namespace blink { | 37 namespace blink { |
| 37 | 38 |
| 38 WorkerNavigatorStorageQuota::WorkerNavigatorStorageQuota() | 39 WorkerNavigatorStorageQuota::WorkerNavigatorStorageQuota() |
| 39 { | 40 { |
| 40 } | 41 } |
| 41 | 42 |
| 42 const char* WorkerNavigatorStorageQuota::supplementName() | 43 const char* WorkerNavigatorStorageQuota::supplementName() |
| 43 { | 44 { |
| 44 return "WorkerNavigatorStorageQuota"; | 45 return "WorkerNavigatorStorageQuota"; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 57 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage(Work
erNavigator& navigator) | 58 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage(Work
erNavigator& navigator) |
| 58 { | 59 { |
| 59 return WorkerNavigatorStorageQuota::from(navigator).webkitTemporaryStorage()
; | 60 return WorkerNavigatorStorageQuota::from(navigator).webkitTemporaryStorage()
; |
| 60 } | 61 } |
| 61 | 62 |
| 62 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage(Wor
kerNavigator& navigator) | 63 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage(Wor
kerNavigator& navigator) |
| 63 { | 64 { |
| 64 return WorkerNavigatorStorageQuota::from(navigator).webkitPersistentStorage(
); | 65 return WorkerNavigatorStorageQuota::from(navigator).webkitPersistentStorage(
); |
| 65 } | 66 } |
| 66 | 67 |
| 68 StorageManager* WorkerNavigatorStorageQuota::storage(WorkerNavigator& navigator) |
| 69 { |
| 70 return WorkerNavigatorStorageQuota::from(navigator).storage(); |
| 71 } |
| 72 |
| 67 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage() co
nst | 73 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage() co
nst |
| 68 { | 74 { |
| 69 if (!m_temporaryStorage) | 75 if (!m_temporaryStorage) |
| 70 m_temporaryStorage = DeprecatedStorageQuota::create(DeprecatedStorageQuo
ta::Temporary); | 76 m_temporaryStorage = DeprecatedStorageQuota::create(DeprecatedStorageQuo
ta::Temporary); |
| 71 return m_temporaryStorage.get(); | 77 return m_temporaryStorage.get(); |
| 72 } | 78 } |
| 73 | 79 |
| 74 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage() c
onst | 80 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage() c
onst |
| 75 { | 81 { |
| 76 if (!m_persistentStorage) | 82 if (!m_persistentStorage) |
| 77 m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStorageQu
ota::Persistent); | 83 m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStorageQu
ota::Persistent); |
| 78 return m_persistentStorage.get(); | 84 return m_persistentStorage.get(); |
| 79 } | 85 } |
| 80 | 86 |
| 87 StorageManager* WorkerNavigatorStorageQuota::storage() const |
| 88 { |
| 89 if (!m_storageManager) |
| 90 m_storageManager = new StorageManager(); |
| 91 return m_storageManager.get(); |
| 92 } |
| 93 |
| 81 DEFINE_TRACE(WorkerNavigatorStorageQuota) | 94 DEFINE_TRACE(WorkerNavigatorStorageQuota) |
| 82 { | 95 { |
| 83 visitor->trace(m_temporaryStorage); | 96 visitor->trace(m_temporaryStorage); |
| 84 visitor->trace(m_persistentStorage); | 97 visitor->trace(m_persistentStorage); |
| 98 visitor->trace(m_storageManager); |
| 85 HeapSupplement<WorkerNavigator>::trace(visitor); | 99 HeapSupplement<WorkerNavigator>::trace(visitor); |
| 86 } | 100 } |
| 87 | 101 |
| 88 } // namespace blink | 102 } // namespace blink |
| OLD | NEW |