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

Side by Side Diff: ppapi/proxy/plugin_dispatcher.cc

Issue 692683003: Hold the Pepper proxy lock for all Pepper GL calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove virtual for override functions Created 6 years, 1 month 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/plugin_dispatcher.h ('k') | ppapi/proxy/ppapi_command_buffer_proxy.cc » ('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/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
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
214 bool PluginDispatcher::OnMessageReceived(const IPC::Message& msg) { 223 bool PluginDispatcher::OnMessageReceived(const IPC::Message& msg) {
215 // We need to grab the proxy lock to ensure that we don't collide with the 224 // We need to grab the proxy lock to ensure that we don't collide with the
216 // plugin making pepper calls on a different thread. 225 // plugin making pepper calls on a different thread.
217 ProxyAutoLock lock; 226 ProxyAutoLock lock;
218 TRACE_EVENT2("ppapi proxy", "PluginDispatcher::OnMessageReceived", 227 TRACE_EVENT2("ppapi proxy", "PluginDispatcher::OnMessageReceived",
219 "Class", IPC_MESSAGE_ID_CLASS(msg.type()), 228 "Class", IPC_MESSAGE_ID_CLASS(msg.type()),
220 "Line", IPC_MESSAGE_ID_LINE(msg.type())); 229 "Line", IPC_MESSAGE_ID_LINE(msg.type()));
221 230
222 if (msg.routing_id() == MSG_ROUTING_CONTROL) { 231 if (msg.routing_id() == MSG_ROUTING_CONTROL) {
223 // Handle some plugin-specific control messages. 232 // Handle some plugin-specific control messages.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 // once they're set. The user will have to restart to get new font prefs 329 // once they're set. The user will have to restart to get new font prefs
321 // propogated to plugins. 330 // propogated to plugins.
322 if (!received_preferences_) { 331 if (!received_preferences_) {
323 received_preferences_ = true; 332 received_preferences_ = true;
324 preferences_ = prefs; 333 preferences_ = prefs;
325 } 334 }
326 } 335 }
327 336
328 } // namespace proxy 337 } // namespace proxy
329 } // namespace ppapi 338 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.h ('k') | ppapi/proxy/ppapi_command_buffer_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698