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_util.h" | 5 #include "content/common/npobject_util.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "content/common/np_channel_base.h" | 8 #include "content/common/np_channel_base.h" |
9 #include "content/common/npobject_proxy.h" | 9 #include "content/common/npobject_proxy.h" |
10 #include "content/common/plugin_messages.h" | 10 #include "content/common/plugin_messages.h" |
11 #include "third_party/npapi/bindings/nphostapi.h" | 11 #include "third_party/npapi/bindings/nphostapi.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
13 #include "webkit/plugins/npapi/plugin_host.h" | 13 #include "webkit/plugins/npapi/plugin_host.h" |
14 #include "webkit/glue/webkit_glue.h" | 14 #include "webkit/glue/webkit_glue.h" |
15 | 15 |
16 using WebKit::WebBindings; | 16 using WebKit::WebBindings; |
17 | 17 |
| 18 namespace content { |
| 19 |
18 // true if the current process is a plugin process, false otherwise. | 20 // true if the current process is a plugin process, false otherwise. |
19 static bool g_plugin_process; | 21 static bool g_plugin_process; |
20 | 22 |
21 namespace { | 23 namespace { |
22 // The next 7 functions are called by the plugin code when it's using the | 24 // The next 7 functions are called by the plugin code when it's using the |
23 // NPObject. Plugins always ignore the functions in NPClass (except allocate | 25 // NPObject. Plugins always ignore the functions in NPClass (except allocate |
24 // and deallocate), and instead just use the function pointers that were | 26 // and deallocate), and instead just use the function pointers that were |
25 // passed in NPInitialize. | 27 // passed in NPInitialize. |
26 // When the renderer interacts with an NPObject from the plugin, it of course | 28 // When the renderer interacts with an NPObject from the plugin, it of course |
27 // uses the function pointers in its NPClass structure. | 29 // uses the function pointers in its NPClass structure. |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 result->type = NPVariantType_Object; | 281 result->type = NPVariantType_Object; |
280 result->value.objectValue = npobject_base->GetUnderlyingNPObject(); | 282 result->value.objectValue = npobject_base->GetUnderlyingNPObject(); |
281 WebBindings::retainObject(result->value.objectValue); | 283 WebBindings::retainObject(result->value.objectValue); |
282 break; | 284 break; |
283 } | 285 } |
284 default: | 286 default: |
285 NOTREACHED(); | 287 NOTREACHED(); |
286 } | 288 } |
287 return true; | 289 return true; |
288 } | 290 } |
| 291 |
| 292 } // namespace content |
OLD | NEW |