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

Unified Diff: ppapi/host/ppapi_host.cc

Issue 1864293002: Convert //ppapi to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more nullptr Created 4 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
« no previous file with comments | « ppapi/host/ppapi_host.h ('k') | ppapi/nacl_irt/irt_pnacl_translator_compile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/host/ppapi_host.cc
diff --git a/ppapi/host/ppapi_host.cc b/ppapi/host/ppapi_host.cc
index a194c235f0ac306ee6efc9ed29705d64bf9f1011..f3c68fab3de675f3953337773060292781329cae 100644
--- a/ppapi/host/ppapi_host.cc
+++ b/ppapi/host/ppapi_host.cc
@@ -126,11 +126,11 @@ void PpapiHost::SendUnsolicitedReplyWithHandles(
Send(new PpapiPluginMsg_ResourceReply(params, msg));
}
-scoped_ptr<ResourceHost> PpapiHost::CreateResourceHost(
+std::unique_ptr<ResourceHost> PpapiHost::CreateResourceHost(
PP_Resource resource,
PP_Instance instance,
const IPC::Message& nested_msg) {
- scoped_ptr<ResourceHost> resource_host;
+ std::unique_ptr<ResourceHost> resource_host;
DCHECK(!host_factory_filters_.empty()); // Caller forgot to add a factory.
for (size_t i = 0; i < host_factory_filters_.size(); i++) {
resource_host = host_factory_filters_[i]->CreateResourceHost(
@@ -141,7 +141,8 @@ scoped_ptr<ResourceHost> PpapiHost::CreateResourceHost(
return resource_host;
}
-int PpapiHost::AddPendingResourceHost(scoped_ptr<ResourceHost> resource_host) {
+int PpapiHost::AddPendingResourceHost(
+ std::unique_ptr<ResourceHost> resource_host) {
// The resource ID should not be assigned.
if (!resource_host.get() || resource_host->pp_resource() != 0) {
NOTREACHED();
@@ -158,12 +159,12 @@ int PpapiHost::AddPendingResourceHost(scoped_ptr<ResourceHost> resource_host) {
return pending_id;
}
-void PpapiHost::AddHostFactoryFilter(scoped_ptr<HostFactory> filter) {
+void PpapiHost::AddHostFactoryFilter(std::unique_ptr<HostFactory> filter) {
host_factory_filters_.push_back(std::move(filter));
}
void PpapiHost::AddInstanceMessageFilter(
- scoped_ptr<InstanceMessageFilter> filter) {
+ std::unique_ptr<InstanceMessageFilter> filter) {
instance_message_filters_.push_back(std::move(filter));
}
@@ -235,7 +236,7 @@ void PpapiHost::OnHostMsgResourceCreated(
}
// Run through all filters until one grabs this message.
- scoped_ptr<ResourceHost> resource_host =
+ std::unique_ptr<ResourceHost> resource_host =
CreateResourceHost(params.pp_resource(), instance, nested_msg);
if (!resource_host.get()) {
@@ -274,7 +275,8 @@ void PpapiHost::OnHostMsgResourceDestroyed(PP_Resource resource) {
// element will be there or not. Therefore, we delay destruction of the
// HostResource until after we've made sure the map no longer contains
// |resource|.
- scoped_ptr<ResourceHost> delete_at_end_of_scope(std::move(found->second));
+ std::unique_ptr<ResourceHost> delete_at_end_of_scope(
+ std::move(found->second));
resources_.erase(found);
}
« no previous file with comments | « ppapi/host/ppapi_host.h ('k') | ppapi/nacl_irt/irt_pnacl_translator_compile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698