| 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/plugin_dispatcher.h" | 5 #include "ppapi/proxy/plugin_dispatcher.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (!msg->is_reply()) | 204 if (!msg->is_reply()) |
| 205 msg->set_unblock(true); | 205 msg->set_unblock(true); |
| 206 if (msg->is_sync()) { | 206 if (msg->is_sync()) { |
| 207 // Synchronous messages might be re-entrant, so we need to drop the lock. | 207 // Synchronous messages might be re-entrant, so we need to drop the lock. |
| 208 ProxyAutoUnlock unlock; | 208 ProxyAutoUnlock unlock; |
| 209 return SendMessage(msg); | 209 return SendMessage(msg); |
| 210 } | 210 } |
| 211 return SendMessage(msg); | 211 return SendMessage(msg); |
| 212 } | 212 } |
| 213 | 213 |
| 214 bool PluginDispatcher::SendAndStayLocked(IPC::Message* msg) { | |
| 215 TRACE_EVENT2("ppapi proxy", "PluginDispatcher::SendAndStayLocked", | |
| 216 "Class", IPC_MESSAGE_ID_CLASS(msg->type()), | |
| 217 "Line", IPC_MESSAGE_ID_LINE(msg->type())); | |
| 218 if (!msg->is_reply()) | |
| 219 msg->set_unblock(true); | |
| 220 return SendMessage(msg); | |
| 221 } | |
| 222 | |
| 223 bool PluginDispatcher::OnMessageReceived(const IPC::Message& msg) { | 214 bool PluginDispatcher::OnMessageReceived(const IPC::Message& msg) { |
| 224 // We need to grab the proxy lock to ensure that we don't collide with the | 215 // We need to grab the proxy lock to ensure that we don't collide with the |
| 225 // plugin making pepper calls on a different thread. | 216 // plugin making pepper calls on a different thread. |
| 226 ProxyAutoLock lock; | 217 ProxyAutoLock lock; |
| 227 TRACE_EVENT2("ppapi proxy", "PluginDispatcher::OnMessageReceived", | 218 TRACE_EVENT2("ppapi proxy", "PluginDispatcher::OnMessageReceived", |
| 228 "Class", IPC_MESSAGE_ID_CLASS(msg.type()), | 219 "Class", IPC_MESSAGE_ID_CLASS(msg.type()), |
| 229 "Line", IPC_MESSAGE_ID_LINE(msg.type())); | 220 "Line", IPC_MESSAGE_ID_LINE(msg.type())); |
| 230 | 221 |
| 231 if (msg.routing_id() == MSG_ROUTING_CONTROL) { | 222 if (msg.routing_id() == MSG_ROUTING_CONTROL) { |
| 232 // Handle some plugin-specific control messages. | 223 // Handle some plugin-specific control messages. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 // once they're set. The user will have to restart to get new font prefs | 320 // once they're set. The user will have to restart to get new font prefs |
| 330 // propogated to plugins. | 321 // propogated to plugins. |
| 331 if (!received_preferences_) { | 322 if (!received_preferences_) { |
| 332 received_preferences_ = true; | 323 received_preferences_ = true; |
| 333 preferences_ = prefs; | 324 preferences_ = prefs; |
| 334 } | 325 } |
| 335 } | 326 } |
| 336 | 327 |
| 337 } // namespace proxy | 328 } // namespace proxy |
| 338 } // namespace ppapi | 329 } // namespace ppapi |
| OLD | NEW |