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

Side by Side Diff: content/child/service_worker/web_service_worker_registration_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_registration_impl.h" 5 #include "content/child/service_worker/web_service_worker_registration_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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 int64_t WebServiceWorkerRegistrationImpl::registration_id() const { 148 int64_t WebServiceWorkerRegistrationImpl::registration_id() const {
149 return handle_ref_->registration_id(); 149 return handle_ref_->registration_id();
150 } 150 }
151 151
152 // static 152 // static
153 std::unique_ptr<blink::WebServiceWorkerRegistration::Handle> 153 std::unique_ptr<blink::WebServiceWorkerRegistration::Handle>
154 WebServiceWorkerRegistrationImpl::CreateHandle( 154 WebServiceWorkerRegistrationImpl::CreateHandle(
155 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration) { 155 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration) {
156 if (!registration) 156 if (!registration)
157 return nullptr; 157 return nullptr;
158 return base::WrapUnique(new HandleImpl(registration)); 158 return base::MakeUnique<HandleImpl>(registration);
159 } 159 }
160 160
161 blink::WebServiceWorkerRegistration::Handle* 161 blink::WebServiceWorkerRegistration::Handle*
162 WebServiceWorkerRegistrationImpl::CreateLeakyHandle( 162 WebServiceWorkerRegistrationImpl::CreateLeakyHandle(
163 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration) { 163 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration) {
164 if (!registration) 164 if (!registration)
165 return nullptr; 165 return nullptr;
166 return new HandleImpl(registration); 166 return new HandleImpl(registration);
167 } 167 }
168 168
169 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() { 169 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() {
170 ServiceWorkerDispatcher* dispatcher = 170 ServiceWorkerDispatcher* dispatcher =
171 ServiceWorkerDispatcher::GetThreadSpecificInstance(); 171 ServiceWorkerDispatcher::GetThreadSpecificInstance();
172 if (dispatcher) 172 if (dispatcher)
173 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id()); 173 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id());
174 } 174 }
175 175
176 } // namespace content 176 } // namespace content
OLDNEW
« no previous file with comments | « content/child/service_worker/web_service_worker_impl.cc ('k') | content/child/shared_memory_data_consumer_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698