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" | |
10 #include "chrome/plugin/npobject_util.h" | 9 #include "chrome/plugin/npobject_util.h" |
11 #include "chrome/plugin/plugin_channel_base.h" | 10 #include "chrome/plugin/plugin_channel_base.h" |
12 #include "webkit/glue/webkit_glue.h" | 11 #include "webkit/glue/webkit_glue.h" |
13 #include "webkit/glue/plugins/plugin_instance.h" | 12 #include "webkit/glue/plugins/plugin_instance.h" |
14 | 13 |
15 | 14 |
16 struct NPObjectWrapper { | 15 struct NPObjectWrapper { |
17 NPObject object; | 16 NPObject object; |
18 NPObjectProxy* proxy; | 17 NPObjectProxy* proxy; |
19 }; | 18 }; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 NPVariant_Param param; | 294 NPVariant_Param param; |
296 proxy->Send(new NPObjectMsg_RemoveProperty( | 295 proxy->Send(new NPObjectMsg_RemoveProperty( |
297 proxy->route_id(), name_param, &result)); | 296 proxy->route_id(), name_param, &result)); |
298 // Send may delete proxy. | 297 // Send may delete proxy. |
299 proxy = NULL; | 298 proxy = NULL; |
300 | 299 |
301 return result; | 300 return result; |
302 } | 301 } |
303 | 302 |
304 void NPObjectProxy::NPPInvalidate(NPObject *obj) { | 303 void NPObjectProxy::NPPInvalidate(NPObject *obj) { |
305 bool result = false; | |
306 NPObjectProxy* proxy = GetProxy(obj); | 304 NPObjectProxy* proxy = GetProxy(obj); |
307 if (!proxy) { | 305 if (!proxy) { |
308 return obj->_class->invalidate(obj); | 306 obj->_class->invalidate(obj); |
| 307 return; |
309 } | 308 } |
310 | 309 |
311 proxy->Send(new NPObjectMsg_Invalidate(proxy->route_id())); | 310 proxy->Send(new NPObjectMsg_Invalidate(proxy->route_id())); |
312 // Send may delete proxy. | 311 // Send may delete proxy. |
313 proxy = NULL; | 312 proxy = NULL; |
314 } | 313 } |
315 | 314 |
316 bool NPObjectProxy::NPNEnumerate(NPObject *obj, | 315 bool NPObjectProxy::NPNEnumerate(NPObject *obj, |
317 NPIdentifier **value, | 316 NPIdentifier **value, |
318 uint32_t *count) { | 317 uint32_t *count) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 return; | 391 return; |
393 } | 392 } |
394 | 393 |
395 NPVariant_Param result_param; | 394 NPVariant_Param result_param; |
396 std::string message_str(message); | 395 std::string message_str(message); |
397 | 396 |
398 proxy->Send(new NPObjectMsg_SetException(proxy->route_id(), message_str)); | 397 proxy->Send(new NPObjectMsg_SetException(proxy->route_id(), message_str)); |
399 // Send may delete proxy. | 398 // Send may delete proxy. |
400 proxy = NULL; | 399 proxy = NULL; |
401 } | 400 } |
OLD | NEW |