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 |
15 #include "chrome/plugin/npobject_stub.h" | 16 #include "chrome/plugin/npobject_stub.h" |
16 | 17 |
17 struct _NPVariant; | 18 struct _NPVariant; |
18 typedef _NPVariant NPVariant; | 19 typedef _NPVariant NPVariant; |
19 class NPObjectProxy; | 20 class NPObjectProxy; |
20 class PluginChannelBase; | 21 class PluginChannelBase; |
21 struct NPIdentifier_Param; | 22 struct NPIdentifier_Param; |
22 struct NPVariant_Param; | 23 struct NPVariant_Param; |
23 typedef void *NPIdentifier; | 24 typedef void *NPIdentifier; |
24 | 25 |
(...skipping 19 matching lines...) Expand all Loading... |
44 // If the containing NPObject happens to be an NPObject, then a stub | 45 // If the containing NPObject happens to be an NPObject, then a stub |
45 // is created around it and param holds the routing id for it. | 46 // is created around it and param holds the routing id for it. |
46 // If release is true, the NPVariant object is released (except if | 47 // If release is true, the NPVariant object is released (except if |
47 // it contains an NPObject, since the stub will manage its lifetime). | 48 // it contains an NPObject, since the stub will manage its lifetime). |
48 void CreateNPVariantParam(const NPVariant& variant, | 49 void CreateNPVariantParam(const NPVariant& variant, |
49 PluginChannelBase* channel, | 50 PluginChannelBase* channel, |
50 NPVariant_Param* param, | 51 NPVariant_Param* param, |
51 bool release, | 52 bool release, |
52 base::WaitableEvent* modal_dialog_event); | 53 base::WaitableEvent* modal_dialog_event); |
53 | 54 |
54 #if defined(OS_WIN) | |
55 // Creates an NPVariant from the marshalled object. | 55 // Creates an NPVariant from the marshalled object. |
56 void CreateNPVariant(const NPVariant_Param& param, | 56 void CreateNPVariant(const NPVariant_Param& param, |
57 PluginChannelBase* channel, | 57 PluginChannelBase* channel, |
58 NPVariant* result, | 58 NPVariant* result, |
59 base::WaitableEvent* modal_dialog_event); | 59 base::WaitableEvent* modal_dialog_event); |
60 | 60 |
| 61 #if defined(OS_WIN) |
61 // Given a plugin's HWND, returns an event associated with the WebContents | 62 // Given a plugin's HWND, returns an event associated with the WebContents |
62 // that's set when inside a messagebox. This tells the plugin process that | 63 // that's set when inside a messagebox. This tells the plugin process that |
63 // the message queue should be pumped (as what would happen if everything was | 64 // the message queue should be pumped (as what would happen if everything was |
64 // in-process). This avoids deadlocks when a plugin invokes javascript that | 65 // in-process). This avoids deadlocks when a plugin invokes javascript that |
65 // causes a message box to come up. | 66 // causes a message box to come up. |
66 HANDLE GetMessageBoxEvent(HWND hwnd); | 67 HANDLE GetMessageBoxEvent(HWND hwnd); |
67 #endif // defined(OS_WIN) | 68 #endif // defined(OS_WIN) |
68 | 69 |
69 #endif // CHROME_PLUGIN_NPOBJECT_UTIL_H__ | 70 #endif // CHROME_PLUGIN_NPOBJECT_UTIL_H__ |
OLD | NEW |