| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/plugin/npobject_proxy.h" | 5 #include "chrome/plugin/npobject_proxy.h" |
| 6 | 6 |
| 7 #include "base/waitable_event.h" | 7 #include "base/waitable_event.h" |
| 8 #include "chrome/common/plugin_messages.h" | 8 #include "chrome/common/plugin_messages.h" |
| 9 #include "chrome/common/win_util.h" | 9 #include "chrome/common/win_util.h" |
| 10 #include "chrome/plugin/npobject_util.h" | 10 #include "chrome/plugin/npobject_util.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } else { | 156 } else { |
| 157 CreateNPIdentifierParam(name, &name_param); | 157 CreateNPIdentifierParam(name, &name_param); |
| 158 } | 158 } |
| 159 | 159 |
| 160 // Note: This instance can get destroyed in the context of | 160 // Note: This instance can get destroyed in the context of |
| 161 // Send so addref the channel in this scope. | 161 // Send so addref the channel in this scope. |
| 162 scoped_refptr<PluginChannelBase> channel_copy = proxy->channel_; | 162 scoped_refptr<PluginChannelBase> channel_copy = proxy->channel_; |
| 163 std::vector<NPVariant_Param> args_param; | 163 std::vector<NPVariant_Param> args_param; |
| 164 for (unsigned int i = 0; i < arg_count; ++i) { | 164 for (unsigned int i = 0; i < arg_count; ++i) { |
| 165 NPVariant_Param param; | 165 NPVariant_Param param; |
| 166 CreateNPVariantParam(args[i], channel_copy, ¶m, false); | 166 CreateNPVariantParam( |
| 167 args[i], channel_copy, ¶m, false, proxy->modal_dialog_event_); |
| 167 args_param.push_back(param); | 168 args_param.push_back(param); |
| 168 } | 169 } |
| 169 | 170 |
| 170 NPVariant_Param param_result; | 171 NPVariant_Param param_result; |
| 171 NPObjectMsg_Invoke* msg = new NPObjectMsg_Invoke( | 172 NPObjectMsg_Invoke* msg = new NPObjectMsg_Invoke( |
| 172 proxy->route_id_, is_default, name_param, args_param, ¶m_result, | 173 proxy->route_id_, is_default, name_param, args_param, ¶m_result, |
| 173 &result); | 174 &result); |
| 174 | 175 |
| 175 // If we're in the plugin process and this invoke leads to a dialog box, the | 176 // If we're in the plugin process and this invoke leads to a dialog box, the |
| 176 // plugin will hang the window hierarchy unless we pump the window message | 177 // plugin will hang the window hierarchy unless we pump the window message |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 bool result = false; | 260 bool result = false; |
| 260 NPObjectProxy* proxy = GetProxy(obj); | 261 NPObjectProxy* proxy = GetProxy(obj); |
| 261 if (!proxy) { | 262 if (!proxy) { |
| 262 return obj->_class->setProperty(obj, name, value); | 263 return obj->_class->setProperty(obj, name, value); |
| 263 } | 264 } |
| 264 | 265 |
| 265 NPIdentifier_Param name_param; | 266 NPIdentifier_Param name_param; |
| 266 CreateNPIdentifierParam(name, &name_param); | 267 CreateNPIdentifierParam(name, &name_param); |
| 267 | 268 |
| 268 NPVariant_Param value_param; | 269 NPVariant_Param value_param; |
| 269 CreateNPVariantParam(*value, proxy->channel(), &value_param, false); | 270 CreateNPVariantParam( |
| 271 *value, proxy->channel(), &value_param, false, |
| 272 proxy->modal_dialog_event_); |
| 270 | 273 |
| 271 proxy->Send(new NPObjectMsg_SetProperty( | 274 proxy->Send(new NPObjectMsg_SetProperty( |
| 272 proxy->route_id(), name_param, value_param, &result)); | 275 proxy->route_id(), name_param, value_param, &result)); |
| 273 // Send may delete proxy. | 276 // Send may delete proxy. |
| 274 proxy = NULL; | 277 proxy = NULL; |
| 275 | 278 |
| 276 return result; | 279 return result; |
| 277 } | 280 } |
| 278 | 281 |
| 279 bool NPObjectProxy::NPRemoveProperty(NPObject *obj, | 282 bool NPObjectProxy::NPRemoveProperty(NPObject *obj, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 } | 391 } |
| 389 | 392 |
| 390 NPVariant_Param result_param; | 393 NPVariant_Param result_param; |
| 391 std::string message_str(message); | 394 std::string message_str(message); |
| 392 | 395 |
| 393 proxy->Send(new NPObjectMsg_SetException(proxy->route_id(), message_str)); | 396 proxy->Send(new NPObjectMsg_SetException(proxy->route_id(), message_str)); |
| 394 // Send may delete proxy. | 397 // Send may delete proxy. |
| 395 proxy = NULL; | 398 proxy = NULL; |
| 396 } | 399 } |
| 397 | 400 |
| OLD | NEW |