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/. */
6 include protocol PPluginIdentifier;
7 include protocol PPluginInstance;
8 include protocol PPluginScriptableObject;
9 include protocol PCrashReporter;
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";
21 intr protocol PPluginModule
23 manages PPluginInstance;
24 manages PPluginIdentifier;
25 manages PCrashReporter;
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.
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.
39 async PPluginIdentifier(nsCString aString,
43 // Window-specific message which instructs the interrupt mechanism to enter
44 // a nested event loop for the current interrupt call.
45 async ProcessNativeEventsInInterruptCall();
48 // Forces the child process to update its plugin function table.
49 intr NP_GetEntryPoints()
52 intr NP_Initialize(uint32_t aFlags)
55 intr PPluginInstance(nsCString aMimeType,
64 intr OptionalFunctionsSupported()
65 returns (bool aURLRedirectNotify, bool aClearSiteData,
66 bool aGetSitesWithData);
68 intr NPP_ClearSiteData(nsCString site, uint64_t flags, uint64_t maxAge)
71 intr NPP_GetSitesWithData()
72 returns (nsCString[] sites);
74 // Windows specific message to set up an audio session in the plugin process
75 async SetAudioSessionData(nsID aID,
76 nsString aDisplayName,
79 async SetParentHangTimeout(uint32_t seconds);
82 returns (NativeThreadId tid, uint32_t processType);
84 intr GeckoGetProfile()
85 returns (nsCString aProfile);
89 * This message is only used on X11 platforms.
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.
99 async BackUpXResources(FileDescriptor aXSocketFd);
102 returns (nsCString userAgent);
104 intr NPN_GetValue_WithBoolReturn(NPNVariable aVariable)
105 returns (NPError aError,
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();
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);
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);
126 sync GetNativeCursorsSupported() returns (bool supported);
128 sync NPN_SetException(nullable PPluginScriptableObject actor,
131 async NPN_ReloadPlugins(bool aReloadPages);
134 } // namespace plugins
135 } // namespace mozilla