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

Side by Side Diff: content/child/service_worker/web_service_worker_impl.cc

Issue 2254173002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/service_worker/web_service_worker_impl.h" 5 #include "content/child/service_worker/web_service_worker_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 thread_safe_sender_->Send( 128 thread_safe_sender_->Send(
129 new ServiceWorkerHostMsg_TerminateWorker(handle_ref_->handle_id())); 129 new ServiceWorkerHostMsg_TerminateWorker(handle_ref_->handle_id()));
130 } 130 }
131 131
132 // static 132 // static
133 std::unique_ptr<blink::WebServiceWorker::Handle> 133 std::unique_ptr<blink::WebServiceWorker::Handle>
134 WebServiceWorkerImpl::CreateHandle( 134 WebServiceWorkerImpl::CreateHandle(
135 const scoped_refptr<WebServiceWorkerImpl>& worker) { 135 const scoped_refptr<WebServiceWorkerImpl>& worker) {
136 if (!worker) 136 if (!worker)
137 return nullptr; 137 return nullptr;
138 return base::WrapUnique(new HandleImpl(worker)); 138 return base::MakeUnique<HandleImpl>(worker);
139 } 139 }
140 140
141 WebServiceWorkerImpl::~WebServiceWorkerImpl() { 141 WebServiceWorkerImpl::~WebServiceWorkerImpl() {
142 ServiceWorkerDispatcher* dispatcher = 142 ServiceWorkerDispatcher* dispatcher =
143 ServiceWorkerDispatcher::GetThreadSpecificInstance(); 143 ServiceWorkerDispatcher::GetThreadSpecificInstance();
144 if (dispatcher) 144 if (dispatcher)
145 dispatcher->RemoveServiceWorker(handle_ref_->handle_id()); 145 dispatcher->RemoveServiceWorker(handle_ref_->handle_id());
146 } 146 }
147 147
148 } // namespace content 148 } // namespace content
OLDNEW
« no previous file with comments | « content/child/resource_dispatcher_unittest.cc ('k') | content/child/service_worker/web_service_worker_registration_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698