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 "content/common/npobject_stub.h" | 5 #include "content/common/npobject_stub.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/common/np_channel_base.h" | 8 #include "content/common/np_channel_base.h" |
9 #include "content/common/npobject_util.h" | 9 #include "content/common/npobject_util.h" |
10 #include "content/common/plugin_messages.h" | 10 #include "content/common/plugin_messages.h" |
11 #include "content/public/common/content_client.h" | 11 #include "content/public/common/content_client.h" |
12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
13 #include "third_party/npapi/bindings/npapi.h" | 13 #include "third_party/npapi/bindings/npapi.h" |
14 #include "third_party/npapi/bindings/npruntime.h" | 14 #include "third_party/npapi/bindings/npruntime.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
16 #include "webkit/plugins/npapi/plugin_constants_win.h" | 16 #include "webkit/plugins/npapi/plugin_constants_win.h" |
| 17 #include "webkit/plugins/npapi/plugin_host.h" |
17 | 18 |
18 using WebKit::WebBindings; | 19 using WebKit::WebBindings; |
19 | 20 |
20 NPObjectStub::NPObjectStub( | 21 NPObjectStub::NPObjectStub( |
21 NPObject* npobject, | 22 NPObject* npobject, |
22 NPChannelBase* channel, | 23 NPChannelBase* channel, |
23 int route_id, | 24 int route_id, |
24 gfx::NativeViewId containing_window, | 25 gfx::NativeViewId containing_window, |
25 const GURL& page_url) | 26 const GURL& page_url) |
26 : npobject_(npobject), | 27 : npobject_(npobject), |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 318 |
318 if (!*result) | 319 if (!*result) |
319 return; | 320 return; |
320 | 321 |
321 for (unsigned int i = 0; i < count; ++i) { | 322 for (unsigned int i = 0; i < count; ++i) { |
322 NPIdentifier_Param param; | 323 NPIdentifier_Param param; |
323 CreateNPIdentifierParam(value_np[i], ¶m); | 324 CreateNPIdentifierParam(value_np[i], ¶m); |
324 value->push_back(param); | 325 value->push_back(param); |
325 } | 326 } |
326 | 327 |
327 NPN_MemFree(value_np); | 328 webkit::npapi::PluginHost::Singleton()->host_functions()->memfree(value_np); |
328 } | 329 } |
329 | 330 |
330 void NPObjectStub::OnConstruct(const std::vector<NPVariant_Param>& args, | 331 void NPObjectStub::OnConstruct(const std::vector<NPVariant_Param>& args, |
331 IPC::Message* reply_msg) { | 332 IPC::Message* reply_msg) { |
332 bool return_value = false; | 333 bool return_value = false; |
333 NPVariant_Param result_param; | 334 NPVariant_Param result_param; |
334 NPVariant result_var; | 335 NPVariant result_var; |
335 | 336 |
336 VOID_TO_NPVARIANT(result_var); | 337 VOID_TO_NPVARIANT(result_var); |
337 | 338 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 389 |
389 bool return_value = WebBindings::evaluateHelper(0, popups_allowed, npobject_, | 390 bool return_value = WebBindings::evaluateHelper(0, popups_allowed, npobject_, |
390 &script_string, &result_var); | 391 &script_string, &result_var); |
391 | 392 |
392 NPVariant_Param result_param; | 393 NPVariant_Param result_param; |
393 CreateNPVariantParam( | 394 CreateNPVariantParam( |
394 result_var, channel_, &result_param, true, containing_window_, page_url_); | 395 result_var, channel_, &result_param, true, containing_window_, page_url_); |
395 NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); | 396 NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); |
396 channel_->Send(reply_msg); | 397 channel_->Send(reply_msg); |
397 } | 398 } |
OLD | NEW |