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 // Helper functions that are used by the NPObject proxy and stub. | 5 // Helper functions that are used by the NPObject proxy and stub. |
6 | 6 |
7 #ifndef CHROME_PLUGIN_NPOBJECT_UTIL_H__ | 7 #ifndef CHROME_PLUGIN_NPOBJECT_UTIL_H__ |
8 #define CHROME_PLUGIN_NPOBJECT_UTIL_H__ | 8 #define CHROME_PLUGIN_NPOBJECT_UTIL_H__ |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 | 11 |
12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
13 #include <windows.h> | 13 #include <windows.h> |
14 #endif | 14 #endif |
15 #include "chrome/plugin/npobject_stub.h" | 15 #include "chrome/plugin/npobject_stub.h" |
16 | 16 |
17 struct _NPVariant; | 17 struct _NPVariant; |
18 typedef _NPVariant NPVariant; | 18 typedef _NPVariant NPVariant; |
19 class NPObjectProxy; | 19 class NPObjectProxy; |
20 class PluginChannelBase; | 20 class PluginChannelBase; |
21 struct NPIdentifier_Param; | 21 struct NPIdentifier_Param; |
22 struct NPVariant_Param; | 22 struct NPVariant_Param; |
23 typedef void *NPIdentifier; | 23 typedef void *NPIdentifier; |
24 | 24 |
| 25 namespace base { |
| 26 class WaitableEvent; |
| 27 } |
25 | 28 |
26 // Needs to be called early in the plugin process lifetime, before any | 29 // Needs to be called early in the plugin process lifetime, before any |
27 // plugin instances are initialized. | 30 // plugin instances are initialized. |
28 void PatchNPNFunctions(); | 31 void PatchNPNFunctions(); |
29 | 32 |
30 // Returns true if the current process is a plugin process, or false if it's a | 33 // Returns true if the current process is a plugin process, or false if it's a |
31 // renderer process. | 34 // renderer process. |
32 bool IsPluginProcess(); | 35 bool IsPluginProcess(); |
33 | 36 |
34 // Creates an object similar to NPIdentifier that can be marshalled. | 37 // Creates an object similar to NPIdentifier that can be marshalled. |
(...skipping 10 matching lines...) Expand all Loading... |
45 void CreateNPVariantParam(const NPVariant& variant, | 48 void CreateNPVariantParam(const NPVariant& variant, |
46 PluginChannelBase* channel, | 49 PluginChannelBase* channel, |
47 NPVariant_Param* param, | 50 NPVariant_Param* param, |
48 bool release); | 51 bool release); |
49 | 52 |
50 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
51 // Creates an NPVariant from the marshalled object. | 54 // Creates an NPVariant from the marshalled object. |
52 void CreateNPVariant(const NPVariant_Param& param, | 55 void CreateNPVariant(const NPVariant_Param& param, |
53 PluginChannelBase* channel, | 56 PluginChannelBase* channel, |
54 NPVariant* result, | 57 NPVariant* result, |
55 HANDLE modal_dialog_event); | 58 base::WaitableEvent* modal_dialog_event); |
56 | 59 |
57 // Given a plugin's HWND, returns an event associated with the WebContents | 60 // Given a plugin's HWND, returns an event associated with the WebContents |
58 // that's set when inside a messagebox. This tells the plugin process that | 61 // that's set when inside a messagebox. This tells the plugin process that |
59 // the message queue should be pumped (as what would happen if everything was | 62 // the message queue should be pumped (as what would happen if everything was |
60 // in-process). This avoids deadlocks when a plugin invokes javascript that | 63 // in-process). This avoids deadlocks when a plugin invokes javascript that |
61 // causes a message box to come up. | 64 // causes a message box to come up. |
62 HANDLE GetMessageBoxEvent(HWND hwnd); | 65 HANDLE GetMessageBoxEvent(HWND hwnd); |
63 #endif // defined(OS_WIN) | 66 #endif // defined(OS_WIN) |
64 | 67 |
65 #endif // CHROME_PLUGIN_NPOBJECT_UTIL_H__ | 68 #endif // CHROME_PLUGIN_NPOBJECT_UTIL_H__ |
66 | 69 |
OLD | NEW |