|
1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 include protocol PPluginIdentifier; |
|
7 include protocol PPluginInstance; |
|
8 include protocol PPluginScriptableObject; |
|
9 include protocol PCrashReporter; |
|
10 |
|
11 |
|
12 using NPError from "npapi.h"; |
|
13 using NPNVariable from "npapi.h"; |
|
14 using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h"; |
|
15 using class mac_plugin_interposing::NSCursorInfo from "mozilla/plugins/PluginMessageUtils.h"; |
|
16 using struct nsID from "nsID.h"; |
|
17 |
|
18 namespace mozilla { |
|
19 namespace plugins { |
|
20 |
|
21 intr protocol PPluginModule |
|
22 { |
|
23 manages PPluginInstance; |
|
24 manages PPluginIdentifier; |
|
25 manages PCrashReporter; |
|
26 |
|
27 both: |
|
28 /** |
|
29 * Sending a void string to this constructor creates an int identifier whereas |
|
30 * sending a non-void string will create a string identifier. This constructor |
|
31 * may be called by either child or parent. If a race occurs by calling the |
|
32 * constructor with the same string or int argument then we create two actors |
|
33 * and detect the second instance in the child. We prevent the parent's actor |
|
34 * from leaking out to plugin code and only allow the child's to be used. |
|
35 * |
|
36 * When calling into the plugin, the parent may create a "temporary" |
|
37 * identifier which is only valid for the lifetime of the current inerrupt frame. |
|
38 */ |
|
39 async PPluginIdentifier(nsCString aString, |
|
40 int32_t aInt, |
|
41 bool temporary); |
|
42 |
|
43 // Window-specific message which instructs the interrupt mechanism to enter |
|
44 // a nested event loop for the current interrupt call. |
|
45 async ProcessNativeEventsInInterruptCall(); |
|
46 |
|
47 child: |
|
48 // Forces the child process to update its plugin function table. |
|
49 intr NP_GetEntryPoints() |
|
50 returns (NPError rv); |
|
51 |
|
52 intr NP_Initialize(uint32_t aFlags) |
|
53 returns (NPError rv); |
|
54 |
|
55 intr PPluginInstance(nsCString aMimeType, |
|
56 uint16_t aMode, |
|
57 nsCString[] aNames, |
|
58 nsCString[] aValues) |
|
59 returns (NPError rv); |
|
60 |
|
61 intr NP_Shutdown() |
|
62 returns (NPError rv); |
|
63 |
|
64 intr OptionalFunctionsSupported() |
|
65 returns (bool aURLRedirectNotify, bool aClearSiteData, |
|
66 bool aGetSitesWithData); |
|
67 |
|
68 intr NPP_ClearSiteData(nsCString site, uint64_t flags, uint64_t maxAge) |
|
69 returns (NPError rv); |
|
70 |
|
71 intr NPP_GetSitesWithData() |
|
72 returns (nsCString[] sites); |
|
73 |
|
74 // Windows specific message to set up an audio session in the plugin process |
|
75 async SetAudioSessionData(nsID aID, |
|
76 nsString aDisplayName, |
|
77 nsString aIconPath); |
|
78 |
|
79 async SetParentHangTimeout(uint32_t seconds); |
|
80 |
|
81 intr PCrashReporter() |
|
82 returns (NativeThreadId tid, uint32_t processType); |
|
83 |
|
84 intr GeckoGetProfile() |
|
85 returns (nsCString aProfile); |
|
86 |
|
87 parent: |
|
88 /** |
|
89 * This message is only used on X11 platforms. |
|
90 * |
|
91 * Send a dup of the plugin process's X socket to the parent |
|
92 * process. In theory, this scheme keeps the plugin's X resources |
|
93 * around until after both the plugin process shuts down *and* the |
|
94 * parent process closes the dup fd. This is used to prevent the |
|
95 * parent process from crashing on X errors if, e.g., the plugin |
|
96 * crashes *just before* a repaint and the parent process tries to |
|
97 * use the newly-invalid surface. |
|
98 */ |
|
99 async BackUpXResources(FileDescriptor aXSocketFd); |
|
100 |
|
101 intr NPN_UserAgent() |
|
102 returns (nsCString userAgent); |
|
103 |
|
104 intr NPN_GetValue_WithBoolReturn(NPNVariable aVariable) |
|
105 returns (NPError aError, |
|
106 bool aBoolVal); |
|
107 |
|
108 // Wake up and process a few native events. Periodically called by |
|
109 // Gtk-specific code upon detecting that the plugin process has |
|
110 // entered a nested event loop. If the browser doesn't process |
|
111 // native events, then "livelock" and some other glitches can occur. |
|
112 intr ProcessSomeEvents(); |
|
113 |
|
114 // OS X Specific calls to manage the plugin's window |
|
115 // when interposing system calls. |
|
116 async PluginShowWindow(uint32_t aWindowId, bool aModal, |
|
117 int32_t aX, int32_t aY, |
|
118 size_t aWidth, size_t aHeight); |
|
119 async PluginHideWindow(uint32_t aWindowId); |
|
120 |
|
121 // OS X Specific calls to allow the plugin to manage the cursor. |
|
122 async SetCursor(NSCursorInfo cursorInfo); |
|
123 async ShowCursor(bool show); |
|
124 async PushCursor(NSCursorInfo cursorInfo); |
|
125 async PopCursor(); |
|
126 sync GetNativeCursorsSupported() returns (bool supported); |
|
127 |
|
128 sync NPN_SetException(nullable PPluginScriptableObject actor, |
|
129 nsCString message); |
|
130 |
|
131 async NPN_ReloadPlugins(bool aReloadPages); |
|
132 }; |
|
133 |
|
134 } // namespace plugins |
|
135 } // namespace mozilla |