| 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 fbc9c840568834f6e2816db14575555708f4eeb0..f57b4ce19dd0583d6a4b47cbbbc1a028a700f7ab 100644
|
| --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp
|
| +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp
|
| @@ -23,9 +23,9 @@
|
| #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h"
|
| #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| -#include "wtf/OwnPtr.h"
|
| -#include "wtf/PassOwnPtr.h"
|
| +#include "wtf/PtrUtil.h"
|
| #include "wtf/text/WTFString.h"
|
| +#include <memory>
|
| #include <v8.h>
|
|
|
| namespace blink {
|
| @@ -162,7 +162,7 @@ protected:
|
| v8::Isolate* isolate() { return v8::Isolate::GetCurrent(); }
|
| ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->document().frame()); }
|
|
|
| - void provide(PassOwnPtr<WebServiceWorkerProvider> provider)
|
| + void provide(std::unique_ptr<WebServiceWorkerProvider> provider)
|
| {
|
| Supplement<Document>::provideTo(m_page->document(), ServiceWorkerContainerClient::supplementName(), ServiceWorkerContainerClient::create(std::move(provider)));
|
| }
|
| @@ -180,7 +180,7 @@ protected:
|
| {
|
| // When the registration is rejected, a register call must not reach
|
| // the provider.
|
| - provide(adoptPtr(new NotReachedWebServiceWorkerProvider()));
|
| + provide(wrapUnique(new NotReachedWebServiceWorkerProvider()));
|
|
|
| ServiceWorkerContainer* container = ServiceWorkerContainer::create(getExecutionContext());
|
| ScriptState::Scope scriptScope(getScriptState());
|
| @@ -194,7 +194,7 @@ protected:
|
|
|
| void testGetRegistrationRejected(const String& documentURL, const ScriptValueTest& valueTest)
|
| {
|
| - provide(adoptPtr(new NotReachedWebServiceWorkerProvider()));
|
| + provide(wrapUnique(new NotReachedWebServiceWorkerProvider()));
|
|
|
| ServiceWorkerContainer* container = ServiceWorkerContainer::create(getExecutionContext());
|
| ScriptState::Scope scriptScope(getScriptState());
|
| @@ -205,7 +205,7 @@ protected:
|
| }
|
|
|
| private:
|
| - OwnPtr<DummyPageHolder> m_page;
|
| + std::unique_ptr<DummyPageHolder> m_page;
|
| };
|
|
|
| TEST_F(ServiceWorkerContainerTest, Register_NonSecureOriginIsRejected)
|
| @@ -263,9 +263,9 @@ public:
|
| // StubWebServiceWorkerProvider, but |registerServiceWorker| and
|
| // other methods must not be called after the
|
| // StubWebServiceWorkerProvider dies.
|
| - PassOwnPtr<WebServiceWorkerProvider> provider()
|
| + std::unique_ptr<WebServiceWorkerProvider> provider()
|
| {
|
| - return adoptPtr(new WebServiceWorkerProviderImpl(*this));
|
| + return wrapUnique(new WebServiceWorkerProviderImpl(*this));
|
| }
|
|
|
| size_t registerCallCount() { return m_registerCallCount; }
|
| @@ -289,14 +289,14 @@ private:
|
| m_owner.m_registerCallCount++;
|
| m_owner.m_registerScope = pattern;
|
| m_owner.m_registerScriptURL = scriptURL;
|
| - m_registrationCallbacksToDelete.append(adoptPtr(callbacks));
|
| + m_registrationCallbacksToDelete.append(wrapUnique(callbacks));
|
| }
|
|
|
| void getRegistration(const WebURL& documentURL, WebServiceWorkerGetRegistrationCallbacks* callbacks) override
|
| {
|
| m_owner.m_getRegistrationCallCount++;
|
| m_owner.m_getRegistrationURL = documentURL;
|
| - m_getRegistrationCallbacksToDelete.append(adoptPtr(callbacks));
|
| + m_getRegistrationCallbacksToDelete.append(wrapUnique(callbacks));
|
| }
|
|
|
| bool validateScopeAndScriptURL(const WebURL& scope, const WebURL& scriptURL, WebString* errorMessage)
|
| @@ -306,8 +306,8 @@ private:
|
|
|
| private:
|
| StubWebServiceWorkerProvider& m_owner;
|
| - Vector<OwnPtr<WebServiceWorkerRegistrationCallbacks>> m_registrationCallbacksToDelete;
|
| - Vector<OwnPtr<WebServiceWorkerGetRegistrationCallbacks>> m_getRegistrationCallbacksToDelete;
|
| + Vector<std::unique_ptr<WebServiceWorkerRegistrationCallbacks>> m_registrationCallbacksToDelete;
|
| + Vector<std::unique_ptr<WebServiceWorkerGetRegistrationCallbacks>> m_getRegistrationCallbacksToDelete;
|
| };
|
|
|
| private:
|
|
|