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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.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/serviceworkers/ServiceWorkerClients.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
index 1073dbc2cab68e2b01822a5d313e1ecc33734b40..5cd78721156106c49852e526a316fb28c51c1556 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
@@ -20,6 +20,7 @@
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
#include <memory>
+#include <utility>
namespace blink {
@@ -114,7 +115,7 @@ ScriptPromise ServiceWorkerClients::get(ScriptState* scriptState,
ScriptPromise promise = resolver->promise();
ServiceWorkerGlobalScopeClient::from(executionContext)
- ->getClient(id, new GetCallback(resolver));
+ ->getClient(id, WTF::makeUnique<GetCallback>(resolver));
return promise;
}
@@ -134,7 +135,8 @@ ScriptPromise ServiceWorkerClients::matchAll(
webOptions.includeUncontrolled = options.includeUncontrolled();
ServiceWorkerGlobalScopeClient::from(executionContext)
->getClients(webOptions,
- new CallbackPromiseAdapter<ClientArray, ServiceWorkerError>(
+ WTF::makeUnique<
+ CallbackPromiseAdapter<ClientArray, ServiceWorkerError>>(
resolver));
return promise;
}
@@ -149,9 +151,11 @@ ScriptPromise ServiceWorkerClients::claim(ScriptState* scriptState) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
- WebServiceWorkerClientsClaimCallbacks* callbacks =
- new CallbackPromiseAdapter<void, ServiceWorkerError>(resolver);
- ServiceWorkerGlobalScopeClient::from(executionContext)->claim(callbacks);
+ auto callbacks =
+ WTF::makeUnique<CallbackPromiseAdapter<void, ServiceWorkerError>>(
+ resolver);
+ ServiceWorkerGlobalScopeClient::from(executionContext)
+ ->claim(std::move(callbacks));
return promise;
}
@@ -183,7 +187,7 @@ ScriptPromise ServiceWorkerClients::openWindow(ScriptState* scriptState,
context->consumeWindowInteraction();
ServiceWorkerGlobalScopeClient::from(context)->openWindow(
- parsedUrl, new NavigateClientCallback(resolver));
+ parsedUrl, WTF::makeUnique<NavigateClientCallback>(resolver));
return promise;
}

Powered by Google App Engine
This is Rietveld 408576698