Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp

Issue 2480293004: Mandate unique_ptr for base::IDMap in IDMapOwnPointer mode. (Closed)
Patch Set: Make changes requested by danakj, fix a few more headers Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
diff --git a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
index 40bbfa0569f929446f62dc205d97f5e942e63e1a..99656a054ae04550fe19ee1145d7d0dfb5d1b254 100644
--- a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
+++ b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp
@@ -16,6 +16,7 @@
#include "public/platform/modules/serviceworker/WebServiceWorkerCacheStorage.h"
#include "wtf/PtrUtil.h"
#include <memory>
+#include <utility>
namespace blink {
@@ -237,11 +238,13 @@ ScriptPromise CacheStorage::open(ScriptState* scriptState,
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
const ScriptPromise promise = resolver->promise();
- if (m_webCacheStorage)
+ if (m_webCacheStorage) {
m_webCacheStorage->dispatchOpen(
- new WithCacheCallbacks(cacheName, this, resolver), cacheName);
- else
+ WTF::makeUnique<WithCacheCallbacks>(cacheName, this, resolver),
+ cacheName);
+ } else {
resolver->reject(createNoImplementationException());
+ }
return promise;
}
@@ -255,10 +258,12 @@ ScriptPromise CacheStorage::has(ScriptState* scriptState,
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
const ScriptPromise promise = resolver->promise();
- if (m_webCacheStorage)
- m_webCacheStorage->dispatchHas(new Callbacks(resolver), cacheName);
- else
+ if (m_webCacheStorage) {
+ m_webCacheStorage->dispatchHas(WTF::makeUnique<Callbacks>(resolver),
+ cacheName);
+ } else {
resolver->reject(createNoImplementationException());
+ }
return promise;
}
@@ -272,11 +277,12 @@ ScriptPromise CacheStorage::deleteFunction(ScriptState* scriptState,
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
const ScriptPromise promise = resolver->promise();
- if (m_webCacheStorage)
+ if (m_webCacheStorage) {
m_webCacheStorage->dispatchDelete(
- new DeleteCallbacks(cacheName, this, resolver), cacheName);
- else
+ WTF::makeUnique<DeleteCallbacks>(cacheName, this, resolver), cacheName);
+ } else {
resolver->reject(createNoImplementationException());
+ }
return promise;
}
@@ -290,7 +296,7 @@ ScriptPromise CacheStorage::keys(ScriptState* scriptState,
const ScriptPromise promise = resolver->promise();
if (m_webCacheStorage)
- m_webCacheStorage->dispatchKeys(new KeysCallbacks(resolver));
+ m_webCacheStorage->dispatchKeys(WTF::makeUnique<KeysCallbacks>(resolver));
else
resolver->reject(createNoImplementationException());
@@ -329,7 +335,8 @@ ScriptPromise CacheStorage::matchImpl(ScriptState* scriptState,
}
if (m_webCacheStorage)
- m_webCacheStorage->dispatchMatch(new MatchCallbacks(resolver), webRequest,
+ m_webCacheStorage->dispatchMatch(WTF::makeUnique<MatchCallbacks>(resolver),
+ webRequest,
Cache::toWebQueryParams(options));
else
resolver->reject(createNoImplementationException());
« no previous file with comments | « third_party/WebKit/Source/modules/cachestorage/Cache.cpp ('k') | third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698