OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 24 matching lines...) Expand all Loading... |
35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
37 #include "core/dom/ExecutionContext.h" | 37 #include "core/dom/ExecutionContext.h" |
38 #include "modules/quota/DeprecatedStorageQuota.h" | 38 #include "modules/quota/DeprecatedStorageQuota.h" |
39 #include "modules/quota/StorageErrorCallback.h" | 39 #include "modules/quota/StorageErrorCallback.h" |
40 #include "modules/quota/StorageQuotaCallback.h" | 40 #include "modules/quota/StorageQuotaCallback.h" |
41 #include "modules/quota/StorageUsageCallback.h" | 41 #include "modules/quota/StorageUsageCallback.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
| 45 DEFINE_GC_INFO(DeprecatedStorageInfo); |
| 46 |
45 DeprecatedStorageInfo::DeprecatedStorageInfo() | 47 DeprecatedStorageInfo::DeprecatedStorageInfo() |
46 { | 48 { |
47 ScriptWrappable::init(this); | 49 ScriptWrappable::init(this); |
48 } | 50 } |
49 | 51 |
50 DeprecatedStorageInfo::~DeprecatedStorageInfo() | |
51 { | |
52 } | |
53 | |
54 void DeprecatedStorageInfo::queryUsageAndQuota(ExecutionContext* executionContex
t, int storageType, PassOwnPtr<StorageUsageCallback> successCallback, PassOwnPtr
<StorageErrorCallback> errorCallback) | 52 void DeprecatedStorageInfo::queryUsageAndQuota(ExecutionContext* executionContex
t, int storageType, PassOwnPtr<StorageUsageCallback> successCallback, PassOwnPtr
<StorageErrorCallback> errorCallback) |
55 { | 53 { |
56 // Dispatching the request to DeprecatedStorageQuota, as this interface is d
eprecated in favor of DeprecatedStorageQuota. | 54 // Dispatching the request to DeprecatedStorageQuota, as this interface is d
eprecated in favor of DeprecatedStorageQuota. |
57 DeprecatedStorageQuota* storageQuota = getStorageQuota(storageType); | 55 DeprecatedStorageQuota* storageQuota = getStorageQuota(storageType); |
58 if (!storageQuota) { | 56 if (!storageQuota) { |
59 // Unknown storage type is requested. | 57 // Unknown storage type is requested. |
60 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er
rorCallback, NotSupportedError)); | 58 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er
rorCallback, NotSupportedError)); |
61 return; | 59 return; |
62 } | 60 } |
63 storageQuota->queryUsageAndQuota(executionContext, successCallback, errorCal
lback); | 61 storageQuota->queryUsageAndQuota(executionContext, successCallback, errorCal
lback); |
(...skipping 19 matching lines...) Expand all Loading... |
83 m_temporaryStorage = DeprecatedStorageQuota::create(DeprecatedStorag
eQuota::Temporary); | 81 m_temporaryStorage = DeprecatedStorageQuota::create(DeprecatedStorag
eQuota::Temporary); |
84 return m_temporaryStorage.get(); | 82 return m_temporaryStorage.get(); |
85 case PERSISTENT: | 83 case PERSISTENT: |
86 if (!m_persistentStorage) | 84 if (!m_persistentStorage) |
87 m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStora
geQuota::Persistent); | 85 m_persistentStorage = DeprecatedStorageQuota::create(DeprecatedStora
geQuota::Persistent); |
88 return m_persistentStorage.get(); | 86 return m_persistentStorage.get(); |
89 } | 87 } |
90 return 0; | 88 return 0; |
91 } | 89 } |
92 | 90 |
| 91 void DeprecatedStorageInfo::trace(Visitor* visitor) |
| 92 { |
| 93 visitor->trace(m_temporaryStorage); |
| 94 visitor->trace(m_persistentStorage); |
| 95 } |
| 96 |
93 } // namespace WebCore | 97 } // namespace WebCore |
OLD | NEW |