| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_var_deprecated_proxy.h" | 5 #include "ppapi/proxy/ppb_var_deprecated_proxy.h" |
| 6 | 6 |
| 7 #include <stdlib.h> // For malloc | 7 #include <stdlib.h> // For malloc |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ppapi/c/dev/ppb_var_deprecated.h" | 10 #include "ppapi/c/dev/ppb_var_deprecated.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 &var_deprecated_interface, | 308 &var_deprecated_interface, |
| 309 PPB_VAR_DEPRECATED_INTERFACE, | 309 PPB_VAR_DEPRECATED_INTERFACE, |
| 310 INTERFACE_ID_PPB_VAR_DEPRECATED, | 310 INTERFACE_ID_PPB_VAR_DEPRECATED, |
| 311 false, | 311 false, |
| 312 &CreateVarDeprecatedProxy, | 312 &CreateVarDeprecatedProxy, |
| 313 }; | 313 }; |
| 314 return &info; | 314 return &info; |
| 315 } | 315 } |
| 316 | 316 |
| 317 bool PPB_Var_Deprecated_Proxy::OnMessageReceived(const IPC::Message& msg) { | 317 bool PPB_Var_Deprecated_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 318 // Prevent the dispatcher from going away during a call to Call or other |
| 319 // function that could mutate the DOM. This must happen OUTSIDE of |
| 320 // the message handlers since the SerializedVars use the dispatcher upon |
| 321 // return of the function (converting the SerializedVarReturnValue/OutParam |
| 322 // to a SerializedVar in the destructor). |
| 323 ScopedModuleReference death_grip(dispatcher()); |
| 324 |
| 318 bool handled = true; | 325 bool handled = true; |
| 319 IPC_BEGIN_MESSAGE_MAP(PPB_Var_Deprecated_Proxy, msg) | 326 IPC_BEGIN_MESSAGE_MAP(PPB_Var_Deprecated_Proxy, msg) |
| 320 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVar_HasProperty, | 327 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVar_HasProperty, |
| 321 OnMsgHasProperty) | 328 OnMsgHasProperty) |
| 322 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVar_HasMethodDeprecated, | 329 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVar_HasMethodDeprecated, |
| 323 OnMsgHasMethodDeprecated) | 330 OnMsgHasMethodDeprecated) |
| 324 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVar_GetProperty, | 331 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVar_GetProperty, |
| 325 OnMsgGetProperty) | 332 OnMsgGetProperty) |
| 326 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVar_DeleteProperty, | 333 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVar_DeleteProperty, |
| 327 OnMsgDeleteProperty) | 334 OnMsgDeleteProperty) |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 | 470 |
| 464 void PPB_Var_Deprecated_Proxy::SetAllowPluginReentrancy() { | 471 void PPB_Var_Deprecated_Proxy::SetAllowPluginReentrancy() { |
| 465 if (dispatcher()->IsPlugin()) | 472 if (dispatcher()->IsPlugin()) |
| 466 NOTREACHED(); | 473 NOTREACHED(); |
| 467 else | 474 else |
| 468 static_cast<HostDispatcher*>(dispatcher())->set_allow_plugin_reentrancy(); | 475 static_cast<HostDispatcher*>(dispatcher())->set_allow_plugin_reentrancy(); |
| 469 } | 476 } |
| 470 | 477 |
| 471 } // namespace proxy | 478 } // namespace proxy |
| 472 } // namespace pp | 479 } // namespace pp |
| OLD | NEW |