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

Unified Diff: content/renderer/shared_worker/embedded_shared_worker_stub.cc

Issue 2847983002: Use unique_ptr for Create{ServiceWorkerNetworkProvider,ApplicationCacheHost} (Closed)
Patch Set: addressed comments Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/shared_worker/embedded_shared_worker_stub.cc
diff --git a/content/renderer/shared_worker/embedded_shared_worker_stub.cc b/content/renderer/shared_worker/embedded_shared_worker_stub.cc
index 712b7e7b42db6d8c7e65f304a1c1454a3fb872dc..090ba0ea4fd31039ad3866583fe56dec69014507 100644
--- a/content/renderer/shared_worker/embedded_shared_worker_stub.cc
+++ b/content/renderer/shared_worker/embedded_shared_worker_stub.cc
@@ -215,11 +215,13 @@ EmbeddedSharedWorkerStub::NotificationPresenter() {
return NULL;
}
-blink::WebApplicationCacheHost*
+std::unique_ptr<blink::WebApplicationCacheHost>
EmbeddedSharedWorkerStub::CreateApplicationCacheHost(
blink::WebApplicationCacheHostClient* client) {
- app_cache_host_ = new SharedWorkerWebApplicationCacheHostImpl(client);
- return app_cache_host_;
+ std::unique_ptr<WebApplicationCacheHostImpl> host =
+ base::MakeUnique<SharedWorkerWebApplicationCacheHostImpl>(client);
+ app_cache_host_ = host.get();
+ return std::move(host);
}
blink::WebWorkerContentSettingsClientProxy*
@@ -230,7 +232,7 @@ EmbeddedSharedWorkerStub::CreateWorkerContentSettingsClientProxy(
ChildThreadImpl::current()->thread_safe_sender());
}
-blink::WebServiceWorkerNetworkProvider*
+std::unique_ptr<blink::WebServiceWorkerNetworkProvider>
EmbeddedSharedWorkerStub::CreateServiceWorkerNetworkProvider() {
// Create a content::ServiceWorkerNetworkProvider for this data source so
// we can observe its requests.
@@ -240,8 +242,8 @@ EmbeddedSharedWorkerStub::CreateServiceWorkerNetworkProvider() {
true /* is_parent_frame_secure */));
// Blink is responsible for deleting the returned object.
- return new WebServiceWorkerNetworkProviderImpl(std::move(provider),
- IsOriginSecure(url_));
+ return base::MakeUnique<WebServiceWorkerNetworkProviderImpl>(
+ std::move(provider), IsOriginSecure(url_));
}
void EmbeddedSharedWorkerStub::SendDevToolsMessage(
« no previous file with comments | « content/renderer/shared_worker/embedded_shared_worker_stub.h ('k') | third_party/WebKit/Source/web/LocalFrameClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698