| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 WorkerNavigatorStorageQuota& WorkerNavigatorStorageQuota::from(WorkerNavigator&
navigator) | 47 WorkerNavigatorStorageQuota& WorkerNavigatorStorageQuota::from(WorkerNavigator&
navigator) |
| 48 { | 48 { |
| 49 WorkerNavigatorStorageQuota* supplement = static_cast<WorkerNavigatorStorage
Quota*>(Supplement<WorkerNavigator>::from(navigator, supplementName())); | 49 WorkerNavigatorStorageQuota* supplement = static_cast<WorkerNavigatorStorage
Quota*>(Supplement<WorkerNavigator>::from(navigator, supplementName())); |
| 50 if (!supplement) { | 50 if (!supplement) { |
| 51 supplement = new WorkerNavigatorStorageQuota(); | 51 supplement = new WorkerNavigatorStorageQuota(); |
| 52 provideTo(navigator, supplementName(), supplement); | 52 provideTo(navigator, supplementName(), supplement); |
| 53 } | 53 } |
| 54 return *supplement; | 54 return *supplement; |
| 55 } | 55 } |
| 56 | 56 |
| 57 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage(Work
erNavigator& navigator) | |
| 58 { | |
| 59 return WorkerNavigatorStorageQuota::from(navigator).webkitTemporaryStorage()
; | |
| 60 } | |
| 61 | |
| 62 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage(Wor
kerNavigator& navigator) | |
| 63 { | |
| 64 return WorkerNavigatorStorageQuota::from(navigator).webkitPersistentStorage(
); | |
| 65 } | |
| 66 | |
| 67 StorageManager* WorkerNavigatorStorageQuota::storage(WorkerNavigator& navigator) | 57 StorageManager* WorkerNavigatorStorageQuota::storage(WorkerNavigator& navigator) |
| 68 { | 58 { |
| 69 return WorkerNavigatorStorageQuota::from(navigator).storage(); | 59 return WorkerNavigatorStorageQuota::from(navigator).storage(); |
| 70 } | 60 } |
| 71 | 61 |
| 72 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitTemporaryStorage() co
nst | |
| 73 { | |
| 74 if (!m_temporaryStorage) | |
| 75 m_temporaryStorage = DeprecatedStorageQuota::create(DeprecatedStorageQuo
ta::Temporary); | |
| 76 return m_temporaryStorage.get(); | |
| 77 } | |
| 78 | |
| 79 DeprecatedStorageQuota* WorkerNavigatorStorageQuota::webkitPersistentStorage() c
onst | |
| 80 { | |
| 81 if (!m_persistentStorage) | |
| 82 m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStorageQu
ota::Persistent); | |
| 83 return m_persistentStorage.get(); | |
| 84 } | |
| 85 | |
| 86 StorageManager* WorkerNavigatorStorageQuota::storage() const | 62 StorageManager* WorkerNavigatorStorageQuota::storage() const |
| 87 { | 63 { |
| 88 if (!m_storageManager) | 64 if (!m_storageManager) |
| 89 m_storageManager = new StorageManager(); | 65 m_storageManager = new StorageManager(); |
| 90 return m_storageManager.get(); | 66 return m_storageManager.get(); |
| 91 } | 67 } |
| 92 | 68 |
| 93 DEFINE_TRACE(WorkerNavigatorStorageQuota) | 69 DEFINE_TRACE(WorkerNavigatorStorageQuota) |
| 94 { | 70 { |
| 95 visitor->trace(m_temporaryStorage); | |
| 96 visitor->trace(m_persistentStorage); | |
| 97 visitor->trace(m_storageManager); | 71 visitor->trace(m_storageManager); |
| 98 Supplement<WorkerNavigator>::trace(visitor); | 72 Supplement<WorkerNavigator>::trace(visitor); |
| 99 } | 73 } |
| 100 | 74 |
| 101 } // namespace blink | 75 } // namespace blink |
| OLD | NEW |