OLD | NEW |
---|---|
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> |
bbudge
2016/04/06 21:01:20
#include <memory> ?
It does get pulled in by the
dcheng
2016/04/06 21:18:33
I've changed this to just use base::WrapUnique.
| |
8 | 8 |
9 #include "ppapi/c/ppp_messaging.h" | 9 #include "ppapi/c/ppp_messaging.h" |
10 #include "ppapi/proxy/host_dispatcher.h" | 10 #include "ppapi/proxy/host_dispatcher.h" |
11 #include "ppapi/proxy/message_handler.h" | 11 #include "ppapi/proxy/message_handler.h" |
12 #include "ppapi/proxy/plugin_dispatcher.h" | 12 #include "ppapi/proxy/plugin_dispatcher.h" |
13 #include "ppapi/proxy/plugin_resource_tracker.h" | 13 #include "ppapi/proxy/plugin_resource_tracker.h" |
14 #include "ppapi/proxy/plugin_var_tracker.h" | 14 #include "ppapi/proxy/plugin_var_tracker.h" |
15 #include "ppapi/proxy/ppapi_messages.h" | 15 #include "ppapi/proxy/ppapi_messages.h" |
16 #include "ppapi/proxy/serialized_var.h" | 16 #include "ppapi/proxy/serialized_var.h" |
17 #include "ppapi/shared_impl/ppapi_globals.h" | 17 #include "ppapi/shared_impl/ppapi_globals.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 | 113 |
114 void PPP_Messaging_Proxy::OnMsgHandleBlockingMessage( | 114 void PPP_Messaging_Proxy::OnMsgHandleBlockingMessage( |
115 PP_Instance instance, | 115 PP_Instance instance, |
116 SerializedVarReceiveInput message_data, | 116 SerializedVarReceiveInput message_data, |
117 IPC::Message* reply_msg) { | 117 IPC::Message* reply_msg) { |
118 ScopedPPVar received_var(message_data.GetForInstance(dispatcher(), instance)); | 118 ScopedPPVar received_var(message_data.GetForInstance(dispatcher(), instance)); |
119 MessageHandler* message_handler = GetMessageHandler(dispatcher(), instance); | 119 MessageHandler* message_handler = GetMessageHandler(dispatcher(), instance); |
120 if (message_handler) { | 120 if (message_handler) { |
121 if (message_handler->LoopIsValid()) { | 121 if (message_handler->LoopIsValid()) { |
122 message_handler->HandleBlockingMessage( | 122 message_handler->HandleBlockingMessage( |
123 received_var, scoped_ptr<IPC::Message>(reply_msg)); | 123 received_var, std::unique_ptr<IPC::Message>(reply_msg)); |
124 return; | 124 return; |
125 } else { | 125 } else { |
126 // If the MessageHandler's loop has been quit, then we should treat it as | 126 // 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. | 127 // though it has been unregistered. Also see the note for PostMessage. |
128 ResetMessageHandler(dispatcher(), instance); | 128 ResetMessageHandler(dispatcher(), instance); |
129 } | 129 } |
130 } | 130 } |
131 // We have no handler, but we still need to respond to unblock the renderer | 131 // We have no handler, but we still need to respond to unblock the renderer |
132 // and inform the JavaScript caller. | 132 // and inform the JavaScript caller. |
133 PpapiMsg_PPPMessageHandler_HandleBlockingMessage::WriteReplyParams( | 133 PpapiMsg_PPPMessageHandler_HandleBlockingMessage::WriteReplyParams( |
134 reply_msg, | 134 reply_msg, |
135 SerializedVarReturnValue::Convert(dispatcher(), PP_MakeUndefined()), | 135 SerializedVarReturnValue::Convert(dispatcher(), PP_MakeUndefined()), |
136 false /* was_handled */); | 136 false /* was_handled */); |
137 dispatcher()->Send(reply_msg); | 137 dispatcher()->Send(reply_msg); |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 } // namespace proxy | 141 } // namespace proxy |
142 } // namespace ppapi | 142 } // namespace ppapi |
OLD | NEW |