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

Side by Side Diff: ppapi/proxy/ppb_flash_message_loop_proxy.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 unified diff | Download patch
« no previous file with comments | « ppapi/proxy/ppb_flash_message_loop_proxy.h ('k') | ppapi/proxy/ppb_graphics_3d_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ppapi/proxy/ppb_flash_message_loop_proxy.h" 5 #include "ppapi/proxy/ppb_flash_message_loop_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/private/ppb_flash_message_loop.h" 10 #include "ppapi/c/private/ppb_flash_message_loop.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 128 }
129 129
130 void PPB_Flash_MessageLoop_Proxy::OnMsgRun( 130 void PPB_Flash_MessageLoop_Proxy::OnMsgRun(
131 const HostResource& flash_message_loop, 131 const HostResource& flash_message_loop,
132 IPC::Message* reply) { 132 IPC::Message* reply) {
133 if (!dispatcher()->permissions().HasPermission(PERMISSION_FLASH)) 133 if (!dispatcher()->permissions().HasPermission(PERMISSION_FLASH))
134 return; 134 return;
135 135
136 PPB_Flash_MessageLoop_API::RunFromHostProxyCallback callback = 136 PPB_Flash_MessageLoop_API::RunFromHostProxyCallback callback =
137 base::Bind(&PPB_Flash_MessageLoop_Proxy::WillQuitSoon, AsWeakPtr(), 137 base::Bind(&PPB_Flash_MessageLoop_Proxy::WillQuitSoon, AsWeakPtr(),
138 base::Passed(scoped_ptr<IPC::Message>(reply))); 138 base::Passed(std::unique_ptr<IPC::Message>(reply)));
139 139
140 EnterHostFromHostResource<PPB_Flash_MessageLoop_API> 140 EnterHostFromHostResource<PPB_Flash_MessageLoop_API>
141 enter(flash_message_loop); 141 enter(flash_message_loop);
142 if (enter.succeeded()) 142 if (enter.succeeded())
143 enter.object()->RunFromHostProxy(callback); 143 enter.object()->RunFromHostProxy(callback);
144 else 144 else
145 callback.Run(PP_ERROR_BADRESOURCE); 145 callback.Run(PP_ERROR_BADRESOURCE);
146 } 146 }
147 147
148 void PPB_Flash_MessageLoop_Proxy::OnMsgQuit( 148 void PPB_Flash_MessageLoop_Proxy::OnMsgQuit(
149 const ppapi::HostResource& flash_message_loop) { 149 const ppapi::HostResource& flash_message_loop) {
150 EnterHostFromHostResource<PPB_Flash_MessageLoop_API> 150 EnterHostFromHostResource<PPB_Flash_MessageLoop_API>
151 enter(flash_message_loop); 151 enter(flash_message_loop);
152 if (enter.succeeded()) 152 if (enter.succeeded())
153 enter.object()->Quit(); 153 enter.object()->Quit();
154 } 154 }
155 155
156 void PPB_Flash_MessageLoop_Proxy::WillQuitSoon( 156 void PPB_Flash_MessageLoop_Proxy::WillQuitSoon(
157 scoped_ptr<IPC::Message> reply_message, 157 std::unique_ptr<IPC::Message> reply_message,
158 int32_t result) { 158 int32_t result) {
159 PpapiHostMsg_PPBFlashMessageLoop_Run::WriteReplyParams(reply_message.get(), 159 PpapiHostMsg_PPBFlashMessageLoop_Run::WriteReplyParams(reply_message.get(),
160 result); 160 result);
161 Send(reply_message.release()); 161 Send(reply_message.release());
162 } 162 }
163 163
164 } // namespace proxy 164 } // namespace proxy
165 } // namespace ppapi 165 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_flash_message_loop_proxy.h ('k') | ppapi/proxy/ppb_graphics_3d_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698