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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "public/platform/WebStorageQuotaType.h" | 45 #include "public/platform/WebStorageQuotaType.h" |
46 | 46 |
47 namespace WebCore { | 47 namespace WebCore { |
48 | 48 |
49 DeprecatedStorageQuota::DeprecatedStorageQuota(Type type) | 49 DeprecatedStorageQuota::DeprecatedStorageQuota(Type type) |
50 : m_type(type) | 50 : m_type(type) |
51 { | 51 { |
52 ScriptWrappable::init(this); | 52 ScriptWrappable::init(this); |
53 } | 53 } |
54 | 54 |
| 55 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DeprecatedStorageQuota); |
| 56 |
55 void DeprecatedStorageQuota::queryUsageAndQuota(ExecutionContext* executionConte
xt, PassOwnPtr<StorageUsageCallback> successCallback, PassOwnPtr<StorageErrorCal
lback> errorCallback) | 57 void DeprecatedStorageQuota::queryUsageAndQuota(ExecutionContext* executionConte
xt, PassOwnPtr<StorageUsageCallback> successCallback, PassOwnPtr<StorageErrorCal
lback> errorCallback) |
56 { | 58 { |
57 ASSERT(executionContext); | 59 ASSERT(executionContext); |
58 | 60 |
59 blink::WebStorageQuotaType storageType = static_cast<blink::WebStorageQuotaT
ype>(m_type); | 61 blink::WebStorageQuotaType storageType = static_cast<blink::WebStorageQuotaT
ype>(m_type); |
60 if (storageType != blink::WebStorageQuotaTypeTemporary && storageType != bli
nk::WebStorageQuotaTypePersistent) { | 62 if (storageType != blink::WebStorageQuotaTypeTemporary && storageType != bli
nk::WebStorageQuotaTypePersistent) { |
61 // Unknown storage type is requested. | 63 // Unknown storage type is requested. |
62 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er
rorCallback, NotSupportedError)); | 64 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er
rorCallback, NotSupportedError)); |
63 return; | 65 return; |
64 } | 66 } |
(...skipping 22 matching lines...) Expand all Loading... |
87 | 89 |
88 StorageQuotaClient* client = StorageQuotaClient::from(executionContext); | 90 StorageQuotaClient* client = StorageQuotaClient::from(executionContext); |
89 if (!client) { | 91 if (!client) { |
90 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er
rorCallback, NotSupportedError)); | 92 executionContext->postTask(StorageErrorCallback::CallbackTask::create(er
rorCallback, NotSupportedError)); |
91 return; | 93 return; |
92 } | 94 } |
93 | 95 |
94 client->requestQuota(executionContext, storageType, newQuotaInBytes, success
Callback, errorCallback); | 96 client->requestQuota(executionContext, storageType, newQuotaInBytes, success
Callback, errorCallback); |
95 } | 97 } |
96 | 98 |
97 DeprecatedStorageQuota::~DeprecatedStorageQuota() | |
98 { | |
99 } | |
100 | |
101 } // namespace WebCore | 99 } // namespace WebCore |
OLD | NEW |