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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.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/ServiceWorkerContainerTest.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp
index add153a6bc887076b417749fe50bd3e88a6fd200..6dddc0ca6ff0dc8610a7806e2289196fe9666c30 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp
@@ -26,6 +26,7 @@
#include "wtf/PtrUtil.h"
#include "wtf/text/WTFString.h"
#include <memory>
+#include <utility>
#include <v8.h>
namespace blink {
@@ -126,10 +127,10 @@ class NotReachedWebServiceWorkerProvider : public WebServiceWorkerProvider {
void registerServiceWorker(
const WebURL& pattern,
const WebURL& scriptURL,
- WebServiceWorkerRegistrationCallbacks* callbacks) override {
+ std::unique_ptr<WebServiceWorkerRegistrationCallbacks> callbacks)
+ override {
ADD_FAILURE()
<< "the provider should not be called to register a Service Worker";
- delete callbacks;
}
bool validateScopeAndScriptURL(const WebURL& scope,
@@ -284,19 +285,21 @@ class StubWebServiceWorkerProvider {
void registerServiceWorker(
const WebURL& pattern,
const WebURL& scriptURL,
- WebServiceWorkerRegistrationCallbacks* callbacks) override {
+ std::unique_ptr<WebServiceWorkerRegistrationCallbacks> callbacks)
+ override {
m_owner.m_registerCallCount++;
m_owner.m_registerScope = pattern;
m_owner.m_registerScriptURL = scriptURL;
- m_registrationCallbacksToDelete.append(wrapUnique(callbacks));
+ m_registrationCallbacksToDelete.append(std::move(callbacks));
}
void getRegistration(
const WebURL& documentURL,
- WebServiceWorkerGetRegistrationCallbacks* callbacks) override {
+ std::unique_ptr<WebServiceWorkerGetRegistrationCallbacks> callbacks)
+ override {
m_owner.m_getRegistrationCallCount++;
m_owner.m_getRegistrationURL = documentURL;
- m_getRegistrationCallbacksToDelete.append(wrapUnique(callbacks));
+ m_getRegistrationCallbacksToDelete.append(std::move(callbacks));
}
bool validateScopeAndScriptURL(const WebURL& scope,

Powered by Google App Engine
This is Rietveld 408576698