summaryrefslogtreecommitdiff
path: root/Source/WebCore/Modules/quota
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/Modules/quota')
-rw-r--r--Source/WebCore/Modules/quota/DOMWindowQuota.cpp8
-rw-r--r--Source/WebCore/Modules/quota/DOMWindowQuota.h7
-rw-r--r--Source/WebCore/Modules/quota/DOMWindowQuota.idl4
-rw-r--r--Source/WebCore/Modules/quota/NavigatorStorageQuota.cpp5
-rw-r--r--Source/WebCore/Modules/quota/NavigatorStorageQuota.h7
-rw-r--r--Source/WebCore/Modules/quota/StorageErrorCallback.cpp16
-rw-r--r--Source/WebCore/Modules/quota/StorageErrorCallback.h15
-rw-r--r--Source/WebCore/Modules/quota/StorageErrorCallback.idl4
-rw-r--r--Source/WebCore/Modules/quota/StorageInfo.cpp12
-rw-r--r--Source/WebCore/Modules/quota/StorageInfo.h14
-rw-r--r--Source/WebCore/Modules/quota/StorageInfo.idl4
-rw-r--r--Source/WebCore/Modules/quota/StorageQuota.h14
-rw-r--r--Source/WebCore/Modules/quota/StorageQuota.idl4
-rw-r--r--Source/WebCore/Modules/quota/StorageQuotaCallback.h7
-rw-r--r--Source/WebCore/Modules/quota/StorageQuotaCallback.idl4
-rw-r--r--Source/WebCore/Modules/quota/StorageUsageCallback.h7
-rw-r--r--Source/WebCore/Modules/quota/StorageUsageCallback.idl4
-rw-r--r--Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.cpp5
-rw-r--r--Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.h7
19 files changed, 52 insertions, 96 deletions
diff --git a/Source/WebCore/Modules/quota/DOMWindowQuota.cpp b/Source/WebCore/Modules/quota/DOMWindowQuota.cpp
index ea3d65938..ec7a1b12e 100644
--- a/Source/WebCore/Modules/quota/DOMWindowQuota.cpp
+++ b/Source/WebCore/Modules/quota/DOMWindowQuota.cpp
@@ -37,7 +37,6 @@
#include "Document.h"
#include "Frame.h"
#include "StorageInfo.h"
-#include <wtf/PassRefPtr.h>
namespace WebCore {
@@ -60,8 +59,9 @@ DOMWindowQuota* DOMWindowQuota::from(DOMWindow* window)
{
DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(Supplement<DOMWindow>::from(window, supplementName()));
if (!supplement) {
- supplement = new DOMWindowQuota(window);
- provideTo(window, supplementName(), adoptPtr(supplement));
+ auto newSupplement = std::make_unique<DOMWindowQuota>(window);
+ supplement = newSupplement.get();
+ provideTo(window, supplementName(), WTFMove(newSupplement));
}
return supplement;
}
@@ -75,7 +75,7 @@ StorageInfo* DOMWindowQuota::webkitStorageInfo(DOMWindow* window)
StorageInfo* DOMWindowQuota::webkitStorageInfo() const
{
if (!m_storageInfo && frame()) {
- frame()->document()->addConsoleMessage(JSMessageSource, WarningMessageLevel, "window.webkitStorageInfo is deprecated. Use navigator.webkitTemporaryStorage or navigator.webkitPersistentStorage instead.");
+ frame()->document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral("window.webkitStorageInfo is deprecated. Use navigator.webkitTemporaryStorage or navigator.webkitPersistentStorage instead."));
m_storageInfo = StorageInfo::create();
}
return m_storageInfo.get();
diff --git a/Source/WebCore/Modules/quota/DOMWindowQuota.h b/Source/WebCore/Modules/quota/DOMWindowQuota.h
index ccd434aa3..62d0812db 100644
--- a/Source/WebCore/Modules/quota/DOMWindowQuota.h
+++ b/Source/WebCore/Modules/quota/DOMWindowQuota.h
@@ -28,8 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DOMWindowQuota_h
-#define DOMWindowQuota_h
+#pragma once
#if ENABLE(QUOTA)
@@ -43,13 +42,13 @@ class StorageInfo;
class DOMWindowQuota : public Supplement<DOMWindow>, public DOMWindowProperty {
public:
+ explicit DOMWindowQuota(DOMWindow*);
virtual ~DOMWindowQuota();
static DOMWindowQuota* from(DOMWindow*);
static StorageInfo* webkitStorageInfo(DOMWindow*);
StorageInfo* webkitStorageInfo() const;
private:
- explicit DOMWindowQuota(DOMWindow*);
static const char* supplementName();
mutable RefPtr<StorageInfo> m_storageInfo;
@@ -58,5 +57,3 @@ private:
} // namespace WebCore
#endif // ENABLE(QUOTA)
-
-#endif // DOMWindowQuota_h
diff --git a/Source/WebCore/Modules/quota/DOMWindowQuota.idl b/Source/WebCore/Modules/quota/DOMWindowQuota.idl
index 08c53060a..026b3d256 100644
--- a/Source/WebCore/Modules/quota/DOMWindowQuota.idl
+++ b/Source/WebCore/Modules/quota/DOMWindowQuota.idl
@@ -10,10 +10,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
diff --git a/Source/WebCore/Modules/quota/NavigatorStorageQuota.cpp b/Source/WebCore/Modules/quota/NavigatorStorageQuota.cpp
index 2e0950208..0d86fe729 100644
--- a/Source/WebCore/Modules/quota/NavigatorStorageQuota.cpp
+++ b/Source/WebCore/Modules/quota/NavigatorStorageQuota.cpp
@@ -57,8 +57,9 @@ NavigatorStorageQuota* NavigatorStorageQuota::from(Navigator* navigator)
{
NavigatorStorageQuota* supplement = static_cast<NavigatorStorageQuota*>(Supplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
- supplement = new NavigatorStorageQuota(navigator->frame());
- provideTo(navigator, supplementName(), adoptPtr(supplement));
+ auto newSupplement = std::make_unique<NavigatorStorageQuota>(window);
+ supplement = newSupplement.get();
+ provideTo(navigator, supplementName(), WTFMove(newSupplement));
}
return supplement;
}
diff --git a/Source/WebCore/Modules/quota/NavigatorStorageQuota.h b/Source/WebCore/Modules/quota/NavigatorStorageQuota.h
index 9c1d9ef26..8eb5d423a 100644
--- a/Source/WebCore/Modules/quota/NavigatorStorageQuota.h
+++ b/Source/WebCore/Modules/quota/NavigatorStorageQuota.h
@@ -28,8 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef NavigatorStorageQuota_h
-#define NavigatorStorageQuota_h
+#pragma once
#if ENABLE(QUOTA)
@@ -44,6 +43,7 @@ class Navigator;
class NavigatorStorageQuota : public Supplement<Navigator>, public DOMWindowProperty {
public:
+ explicit NavigatorStorageQuota(Frame*);
virtual ~NavigatorStorageQuota();
static NavigatorStorageQuota* from(Navigator*);
@@ -53,7 +53,6 @@ public:
StorageQuota* webkitPersistentStorage() const;
private:
- explicit NavigatorStorageQuota(Frame*);
static const char* supplementName();
mutable RefPtr<StorageQuota> m_temporaryStorage;
@@ -63,5 +62,3 @@ private:
} // namespace WebCore
#endif // ENABLE(QUOTA)
-
-#endif // NavigatorStorageQuota_h
diff --git a/Source/WebCore/Modules/quota/StorageErrorCallback.cpp b/Source/WebCore/Modules/quota/StorageErrorCallback.cpp
index 983a542b7..6baf4bcbd 100644
--- a/Source/WebCore/Modules/quota/StorageErrorCallback.cpp
+++ b/Source/WebCore/Modules/quota/StorageErrorCallback.cpp
@@ -39,20 +39,14 @@
namespace WebCore {
-StorageErrorCallback::CallbackTask::CallbackTask(PassRefPtr<StorageErrorCallback> callback, ExceptionCode ec)
- : m_callback(callback)
- , m_ec(ec)
+StorageErrorCallback::CallbackTask::CallbackTask(RefPtr<StorageErrorCallback>&& callback, ExceptionCode ec)
+ : ScriptExecutionContext::Task([callback, ec] (ScriptExecutionContext*) {
+ if (callback)
+ callback->handleEvent(DOMCoreException::create(ExceptionCodeDescription(ec)).get());
+ })
{
}
-void StorageErrorCallback::CallbackTask::performTask(ScriptExecutionContext*)
-{
- if (!m_callback)
- return;
- ExceptionCodeDescription description(m_ec);
- m_callback->handleEvent(DOMCoreException::create(description).get());
-}
-
} // namespace WebCore
#endif // ENABLE(QUOTA)
diff --git a/Source/WebCore/Modules/quota/StorageErrorCallback.h b/Source/WebCore/Modules/quota/StorageErrorCallback.h
index ffce7b675..2c980426d 100644
--- a/Source/WebCore/Modules/quota/StorageErrorCallback.h
+++ b/Source/WebCore/Modules/quota/StorageErrorCallback.h
@@ -28,13 +28,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef StorageErrorCallback_h
-#define StorageErrorCallback_h
+#pragma once
#if ENABLE(QUOTA)
#include "ScriptExecutionContext.h"
-#include <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
@@ -50,16 +48,9 @@ public:
class CallbackTask : public ScriptExecutionContext::Task {
public:
- static PassOwnPtr<CallbackTask> create(PassRefPtr<StorageErrorCallback> callback, ExceptionCode ec)
- {
- return adoptPtr(new CallbackTask(callback, ec));
- }
-
- virtual void performTask(ScriptExecutionContext*);
+ CallbackTask(StorageErrorCallback*, ExceptionCode);
private:
- CallbackTask(PassRefPtr<StorageErrorCallback>, ExceptionCode);
-
RefPtr<StorageErrorCallback> m_callback;
ExceptionCode m_ec;
};
@@ -68,5 +59,3 @@ public:
} // namespace WebCore
#endif // ENABLE(QUOTA)
-
-#endif // StorageErrorCallback_h
diff --git a/Source/WebCore/Modules/quota/StorageErrorCallback.idl b/Source/WebCore/Modules/quota/StorageErrorCallback.idl
index b37fbd4fa..ece8ce778 100644
--- a/Source/WebCore/Modules/quota/StorageErrorCallback.idl
+++ b/Source/WebCore/Modules/quota/StorageErrorCallback.idl
@@ -30,6 +30,4 @@
[
Conditional=QUOTA,
-] callback interface StorageErrorCallback {
- boolean handleEvent(DOMCoreException error);
-};
+] callback StorageErrorCallback = void (DOMCoreException error);
diff --git a/Source/WebCore/Modules/quota/StorageInfo.cpp b/Source/WebCore/Modules/quota/StorageInfo.cpp
index 6275ef9d5..cd83a4a92 100644
--- a/Source/WebCore/Modules/quota/StorageInfo.cpp
+++ b/Source/WebCore/Modules/quota/StorageInfo.cpp
@@ -52,28 +52,28 @@ StorageInfo::~StorageInfo()
{
}
-void StorageInfo::queryUsageAndQuota(ScriptExecutionContext* scriptExecutionContext, int storageType, PassRefPtr<StorageUsageCallback> successCallback, PassRefPtr<StorageErrorCallback> errorCallback)
+void StorageInfo::queryUsageAndQuota(ScriptExecutionContext& scriptExecutionContext, int storageType, RefPtr<StorageUsageCallback>&& successCallback, RefPtr<StorageErrorCallback>&& errorCallback)
{
// Dispatching the request to StorageQuota, as this interface is deprecated in favor of StorageQuota.
StorageQuota* storageQuota = getStorageQuota(storageType);
if (!storageQuota) {
// Unknown storage type is requested.
- scriptExecutionContext->postTask(StorageErrorCallback::CallbackTask::create(errorCallback, NOT_SUPPORTED_ERR));
+ scriptExecutionContext->postTask(StorageErrorCallback::CallbackTask::create(WTFMove(errorCallback), NOT_SUPPORTED_ERR));
return;
}
- storageQuota->queryUsageAndQuota(scriptExecutionContext, successCallback, errorCallback);
+ storageQuota->queryUsageAndQuota(scriptExecutionContext, WTFMove(successCallback), WTFMove(errorCallback));
}
-void StorageInfo::requestQuota(ScriptExecutionContext* scriptExecutionContext, int storageType, unsigned long long newQuotaInBytes, PassRefPtr<StorageQuotaCallback> successCallback, PassRefPtr<StorageErrorCallback> errorCallback)
+void StorageInfo::requestQuota(ScriptExecutionContext& scriptExecutionContext, int storageType, unsigned long long newQuotaInBytes, RefPtr<StorageQuotaCallback>&& successCallback, RefPtr<StorageErrorCallback>&& errorCallback)
{
// Dispatching the request to StorageQuota, as this interface is deprecated in favor of StorageQuota.
StorageQuota* storageQuota = getStorageQuota(storageType);
if (!storageQuota) {
// Unknown storage type is requested.
- scriptExecutionContext->postTask(StorageErrorCallback::CallbackTask::create(errorCallback, NOT_SUPPORTED_ERR));
+ scriptExecutionContext->postTask(StorageErrorCallback::CallbackTask::create(WTFMove(errorCallback), NOT_SUPPORTED_ERR));
return;
}
- storageQuota->requestQuota(scriptExecutionContext, newQuotaInBytes, successCallback, errorCallback);
+ storageQuota->requestQuota(scriptExecutionContext, newQuotaInBytes, WTFMove(successCallback), WTFMove(errorCallback));
}
StorageQuota* StorageInfo::getStorageQuota(int storageType)
diff --git a/Source/WebCore/Modules/quota/StorageInfo.h b/Source/WebCore/Modules/quota/StorageInfo.h
index dd50579bf..e56d7b054 100644
--- a/Source/WebCore/Modules/quota/StorageInfo.h
+++ b/Source/WebCore/Modules/quota/StorageInfo.h
@@ -28,12 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef StorageInfo_h
-#define StorageInfo_h
+#pragma once
#if ENABLE(QUOTA)
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -52,14 +50,14 @@ public:
PERSISTENT,
};
- static PassRefPtr<StorageInfo> create()
+ static Ref<StorageInfo> create()
{
- return adoptRef(new StorageInfo());
+ return adoptRef(*new StorageInfo());
}
- void queryUsageAndQuota(ScriptExecutionContext*, int storageType, PassRefPtr<StorageUsageCallback>, PassRefPtr<StorageErrorCallback>);
+ void queryUsageAndQuota(ScriptExecutionContext&, int storageType, RefPtr<StorageUsageCallback>&&, RefPtr<StorageErrorCallback>&&);
- void requestQuota(ScriptExecutionContext*, int storageType, unsigned long long newQuotaInBytes, PassRefPtr<StorageQuotaCallback>, PassRefPtr<StorageErrorCallback>);
+ void requestQuota(ScriptExecutionContext&, int storageType, unsigned long long newQuotaInBytes, RefPtr<StorageQuotaCallback>&&, RefPtr<StorageErrorCallback>&&);
~StorageInfo();
@@ -75,5 +73,3 @@ private:
} // namespace WebCore
#endif // ENABLE(QUOTA)
-
-#endif // StorageInfo_h
diff --git a/Source/WebCore/Modules/quota/StorageInfo.idl b/Source/WebCore/Modules/quota/StorageInfo.idl
index e6157a0d3..062638123 100644
--- a/Source/WebCore/Modules/quota/StorageInfo.idl
+++ b/Source/WebCore/Modules/quota/StorageInfo.idl
@@ -31,6 +31,6 @@
const unsigned short TEMPORARY = 0;
const unsigned short PERSISTENT = 1;
- [CallWith=ScriptExecutionContext] void queryUsageAndQuota(unsigned short storageType, optional StorageUsageCallback usageCallback, optional StorageErrorCallback errorCallback);
- [CallWith=ScriptExecutionContext] void requestQuota(unsigned short storageType, unsigned long long newQuotaInBytes, optional StorageQuotaCallback quotaCallback, optional StorageErrorCallback errorCallback);
+ [CallWith=ScriptExecutionContext] void queryUsageAndQuota(unsigned short storageType, optional StorageUsageCallback? usageCallback, optional StorageErrorCallback? errorCallback);
+ [CallWith=ScriptExecutionContext] void requestQuota(unsigned short storageType, unsigned long long newQuotaInBytes, optional StorageQuotaCallback? quotaCallback, optional StorageErrorCallback? errorCallback);
};
diff --git a/Source/WebCore/Modules/quota/StorageQuota.h b/Source/WebCore/Modules/quota/StorageQuota.h
index 26504f976..7c8d98bb2 100644
--- a/Source/WebCore/Modules/quota/StorageQuota.h
+++ b/Source/WebCore/Modules/quota/StorageQuota.h
@@ -28,12 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef StorageQuota_h
-#define StorageQuota_h
+#pragma once
#if ENABLE(QUOTA)
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
@@ -50,14 +48,14 @@ public:
Persistent,
};
- static PassRefPtr<StorageQuota> create(Type type)
+ static Ref<StorageQuota> create(Type type)
{
- return adoptRef(new StorageQuota(type));
+ return adoptRef(*new StorageQuota(type));
}
- void queryUsageAndQuota(ScriptExecutionContext*, PassRefPtr<StorageUsageCallback>, PassRefPtr<StorageErrorCallback>);
+ void queryUsageAndQuota(ScriptExecutionContext&, RefPtr<StorageUsageCallback>&&, RefPtr<StorageErrorCallback>&&);
- void requestQuota(ScriptExecutionContext*, unsigned long long newQuotaInBytes, PassRefPtr<StorageQuotaCallback>, PassRefPtr<StorageErrorCallback>);
+ void requestQuota(ScriptExecutionContext&, unsigned long long newQuotaInBytes, RefPtr<StorageQuotaCallback>&&, RefPtr<StorageErrorCallback>&&);
~StorageQuota();
@@ -69,5 +67,3 @@ private:
} // namespace WebCore
#endif // ENABLE(QUOTA)
-
-#endif // StorageQuota_h
diff --git a/Source/WebCore/Modules/quota/StorageQuota.idl b/Source/WebCore/Modules/quota/StorageQuota.idl
index 937dc4e18..e596aa3f4 100644
--- a/Source/WebCore/Modules/quota/StorageQuota.idl
+++ b/Source/WebCore/Modules/quota/StorageQuota.idl
@@ -28,6 +28,6 @@
Conditional=QUOTA,
ImplementationLacksVTable,
] interface StorageQuota {
- [CallWith=ScriptExecutionContext] void queryUsageAndQuota(StorageUsageCallback usageCallback, optional StorageErrorCallback errorCallback);
- [CallWith=ScriptExecutionContext] void requestQuota(unsigned long long newQuotaInBytes, optional StorageQuotaCallback quotaCallback, optional StorageErrorCallback errorCallback);
+ [CallWith=ScriptExecutionContext] void queryUsageAndQuota(StorageUsageCallback usageCallback, optional StorageErrorCallback? errorCallback);
+ [CallWith=ScriptExecutionContext] void requestQuota(unsigned long long newQuotaInBytes, optional StorageQuotaCallback? quotaCallback, optional StorageErrorCallback? errorCallback);
};
diff --git a/Source/WebCore/Modules/quota/StorageQuotaCallback.h b/Source/WebCore/Modules/quota/StorageQuotaCallback.h
index a7db0d391..dcd734c7b 100644
--- a/Source/WebCore/Modules/quota/StorageQuotaCallback.h
+++ b/Source/WebCore/Modules/quota/StorageQuotaCallback.h
@@ -28,8 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef StorageQuotaCallback_h
-#define StorageQuotaCallback_h
+#pragma once
#if ENABLE(QUOTA)
@@ -43,8 +42,6 @@ public:
virtual bool handleEvent(unsigned long long grantedQuotaInBytes) = 0;
};
-} // namespace
+} // namespace WebCore
#endif // ENABLE(QUOTA)
-
-#endif // StorageQuotaCallback_h
diff --git a/Source/WebCore/Modules/quota/StorageQuotaCallback.idl b/Source/WebCore/Modules/quota/StorageQuotaCallback.idl
index 4359f2627..0481a9576 100644
--- a/Source/WebCore/Modules/quota/StorageQuotaCallback.idl
+++ b/Source/WebCore/Modules/quota/StorageQuotaCallback.idl
@@ -30,6 +30,4 @@
[
Conditional=QUOTA,
-] callback interface StorageQuotaCallback {
- boolean handleEvent(unsigned long long grantedQuotaInBytes);
-};
+] callback StorageQuotaCallback = void (unsigned long long grantedQuotaInBytes);
diff --git a/Source/WebCore/Modules/quota/StorageUsageCallback.h b/Source/WebCore/Modules/quota/StorageUsageCallback.h
index 5d99f9e68..c424dd619 100644
--- a/Source/WebCore/Modules/quota/StorageUsageCallback.h
+++ b/Source/WebCore/Modules/quota/StorageUsageCallback.h
@@ -28,8 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef StorageUsageCallback_h
-#define StorageUsageCallback_h
+#pragma once
#if ENABLE(QUOTA)
@@ -43,8 +42,6 @@ public:
virtual bool handleEvent(unsigned long long currentUsageInBytes, unsigned long long currentQuotaInBytes) = 0;
};
-} // namespace
+} // namespace WebCore
#endif // ENABLE(QUOTA)
-
-#endif // StorageUsageCallback_h
diff --git a/Source/WebCore/Modules/quota/StorageUsageCallback.idl b/Source/WebCore/Modules/quota/StorageUsageCallback.idl
index 5ea7a0ebc..d6bd5cae5 100644
--- a/Source/WebCore/Modules/quota/StorageUsageCallback.idl
+++ b/Source/WebCore/Modules/quota/StorageUsageCallback.idl
@@ -30,6 +30,4 @@
[
Conditional=QUOTA,
-] callback interface StorageUsageCallback {
- boolean handleEvent(unsigned long long currentUsageInBytes, unsigned long long currentQuotaInBytes);
-};
+] callback StorageUsageCallback = void (unsigned long long currentUsageInBytes, unsigned long long currentQuotaInBytes);
diff --git a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.cpp b/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.cpp
index 90d135b4d..fd5ef4d17 100644
--- a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.cpp
+++ b/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.cpp
@@ -55,8 +55,9 @@ WorkerNavigatorStorageQuota* WorkerNavigatorStorageQuota::from(WorkerNavigator*
{
WorkerNavigatorStorageQuota* supplement = static_cast<WorkerNavigatorStorageQuota*>(Supplement<WorkerNavigator>::from(navigator, supplementName()));
if (!supplement) {
- supplement = new WorkerNavigatorStorageQuota();
- provideTo(navigator, supplementName(), adoptPtr(supplement));
+ auto newSupplement = std::make_unique<WorkerNavigatorStorageQuota>(window);
+ supplement = newSupplement.get();
+ provideTo(navigator, supplementName(), WTFMove(newSupplement));
}
return supplement;
}
diff --git a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.h b/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.h
index a7699f6b4..3456e68f1 100644
--- a/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.h
+++ b/Source/WebCore/Modules/quota/WorkerNavigatorStorageQuota.h
@@ -28,8 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WorkerNavigatorStorageQuota_h
-#define WorkerNavigatorStorageQuota_h
+#pragma once
#if ENABLE(QUOTA)
@@ -44,6 +43,7 @@ class WorkerNavigator;
class WorkerNavigatorStorageQuota : public Supplement<WorkerNavigator> {
public:
+ explicit WorkerNavigatorStorageQuota();
virtual ~WorkerNavigatorStorageQuota();
static WorkerNavigatorStorageQuota* from(WorkerNavigator*);
@@ -53,7 +53,6 @@ public:
StorageQuota* webkitPersistentStorage() const;
private:
- explicit WorkerNavigatorStorageQuota();
static const char* supplementName();
mutable RefPtr<StorageQuota> m_temporaryStorage;
@@ -63,5 +62,3 @@ private:
} // namespace WebCore
#endif // ENABLE(QUOTA)
-
-#endif // WorkerNavigatorStorageQuota_h