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

Side by Side Diff: ppapi/proxy/ppp_messaging_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/ppp_instance_proxy.h ('k') | ppapi/proxy/proxy_channel.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/ppp_messaging_proxy.h" 5 #include "ppapi/proxy/ppp_messaging_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/memory/ptr_util.h"
9 #include "ppapi/c/ppp_messaging.h" 10 #include "ppapi/c/ppp_messaging.h"
10 #include "ppapi/proxy/host_dispatcher.h" 11 #include "ppapi/proxy/host_dispatcher.h"
11 #include "ppapi/proxy/message_handler.h" 12 #include "ppapi/proxy/message_handler.h"
12 #include "ppapi/proxy/plugin_dispatcher.h" 13 #include "ppapi/proxy/plugin_dispatcher.h"
13 #include "ppapi/proxy/plugin_resource_tracker.h" 14 #include "ppapi/proxy/plugin_resource_tracker.h"
14 #include "ppapi/proxy/plugin_var_tracker.h" 15 #include "ppapi/proxy/plugin_var_tracker.h"
15 #include "ppapi/proxy/ppapi_messages.h" 16 #include "ppapi/proxy/ppapi_messages.h"
16 #include "ppapi/proxy/serialized_var.h" 17 #include "ppapi/proxy/serialized_var.h"
17 #include "ppapi/shared_impl/ppapi_globals.h" 18 #include "ppapi/shared_impl/ppapi_globals.h"
18 #include "ppapi/shared_impl/proxy_lock.h" 19 #include "ppapi/shared_impl/proxy_lock.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 113 }
113 114
114 void PPP_Messaging_Proxy::OnMsgHandleBlockingMessage( 115 void PPP_Messaging_Proxy::OnMsgHandleBlockingMessage(
115 PP_Instance instance, 116 PP_Instance instance,
116 SerializedVarReceiveInput message_data, 117 SerializedVarReceiveInput message_data,
117 IPC::Message* reply_msg) { 118 IPC::Message* reply_msg) {
118 ScopedPPVar received_var(message_data.GetForInstance(dispatcher(), instance)); 119 ScopedPPVar received_var(message_data.GetForInstance(dispatcher(), instance));
119 MessageHandler* message_handler = GetMessageHandler(dispatcher(), instance); 120 MessageHandler* message_handler = GetMessageHandler(dispatcher(), instance);
120 if (message_handler) { 121 if (message_handler) {
121 if (message_handler->LoopIsValid()) { 122 if (message_handler->LoopIsValid()) {
122 message_handler->HandleBlockingMessage( 123 message_handler->HandleBlockingMessage(received_var,
123 received_var, scoped_ptr<IPC::Message>(reply_msg)); 124 base::WrapUnique(reply_msg));
124 return; 125 return;
125 } else { 126 } else {
126 // If the MessageHandler's loop has been quit, then we should treat it as 127 // If the MessageHandler's loop has been quit, then we should treat it as
127 // though it has been unregistered. Also see the note for PostMessage. 128 // though it has been unregistered. Also see the note for PostMessage.
128 ResetMessageHandler(dispatcher(), instance); 129 ResetMessageHandler(dispatcher(), instance);
129 } 130 }
130 } 131 }
131 // We have no handler, but we still need to respond to unblock the renderer 132 // We have no handler, but we still need to respond to unblock the renderer
132 // and inform the JavaScript caller. 133 // and inform the JavaScript caller.
133 PpapiMsg_PPPMessageHandler_HandleBlockingMessage::WriteReplyParams( 134 PpapiMsg_PPPMessageHandler_HandleBlockingMessage::WriteReplyParams(
134 reply_msg, 135 reply_msg,
135 SerializedVarReturnValue::Convert(dispatcher(), PP_MakeUndefined()), 136 SerializedVarReturnValue::Convert(dispatcher(), PP_MakeUndefined()),
136 false /* was_handled */); 137 false /* was_handled */);
137 dispatcher()->Send(reply_msg); 138 dispatcher()->Send(reply_msg);
138 } 139 }
139 140
140 141
141 } // namespace proxy 142 } // namespace proxy
142 } // namespace ppapi 143 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppp_instance_proxy.h ('k') | ppapi/proxy/proxy_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698