michael@0: /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: include protocol PPluginIdentifier; michael@0: include protocol PPluginInstance; michael@0: include protocol PPluginScriptableObject; michael@0: include protocol PCrashReporter; michael@0: michael@0: michael@0: using NPError from "npapi.h"; michael@0: using NPNVariable from "npapi.h"; michael@0: using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h"; michael@0: using class mac_plugin_interposing::NSCursorInfo from "mozilla/plugins/PluginMessageUtils.h"; michael@0: using struct nsID from "nsID.h"; michael@0: michael@0: namespace mozilla { michael@0: namespace plugins { michael@0: michael@0: intr protocol PPluginModule michael@0: { michael@0: manages PPluginInstance; michael@0: manages PPluginIdentifier; michael@0: manages PCrashReporter; michael@0: michael@0: both: michael@0: /** michael@0: * Sending a void string to this constructor creates an int identifier whereas michael@0: * sending a non-void string will create a string identifier. This constructor michael@0: * may be called by either child or parent. If a race occurs by calling the michael@0: * constructor with the same string or int argument then we create two actors michael@0: * and detect the second instance in the child. We prevent the parent's actor michael@0: * from leaking out to plugin code and only allow the child's to be used. michael@0: * michael@0: * When calling into the plugin, the parent may create a "temporary" michael@0: * identifier which is only valid for the lifetime of the current inerrupt frame. michael@0: */ michael@0: async PPluginIdentifier(nsCString aString, michael@0: int32_t aInt, michael@0: bool temporary); michael@0: michael@0: // Window-specific message which instructs the interrupt mechanism to enter michael@0: // a nested event loop for the current interrupt call. michael@0: async ProcessNativeEventsInInterruptCall(); michael@0: michael@0: child: michael@0: // Forces the child process to update its plugin function table. michael@0: intr NP_GetEntryPoints() michael@0: returns (NPError rv); michael@0: michael@0: intr NP_Initialize(uint32_t aFlags) michael@0: returns (NPError rv); michael@0: michael@0: intr PPluginInstance(nsCString aMimeType, michael@0: uint16_t aMode, michael@0: nsCString[] aNames, michael@0: nsCString[] aValues) michael@0: returns (NPError rv); michael@0: michael@0: intr NP_Shutdown() michael@0: returns (NPError rv); michael@0: michael@0: intr OptionalFunctionsSupported() michael@0: returns (bool aURLRedirectNotify, bool aClearSiteData, michael@0: bool aGetSitesWithData); michael@0: michael@0: intr NPP_ClearSiteData(nsCString site, uint64_t flags, uint64_t maxAge) michael@0: returns (NPError rv); michael@0: michael@0: intr NPP_GetSitesWithData() michael@0: returns (nsCString[] sites); michael@0: michael@0: // Windows specific message to set up an audio session in the plugin process michael@0: async SetAudioSessionData(nsID aID, michael@0: nsString aDisplayName, michael@0: nsString aIconPath); michael@0: michael@0: async SetParentHangTimeout(uint32_t seconds); michael@0: michael@0: intr PCrashReporter() michael@0: returns (NativeThreadId tid, uint32_t processType); michael@0: michael@0: intr GeckoGetProfile() michael@0: returns (nsCString aProfile); michael@0: michael@0: parent: michael@0: /** michael@0: * This message is only used on X11 platforms. michael@0: * michael@0: * Send a dup of the plugin process's X socket to the parent michael@0: * process. In theory, this scheme keeps the plugin's X resources michael@0: * around until after both the plugin process shuts down *and* the michael@0: * parent process closes the dup fd. This is used to prevent the michael@0: * parent process from crashing on X errors if, e.g., the plugin michael@0: * crashes *just before* a repaint and the parent process tries to michael@0: * use the newly-invalid surface. michael@0: */ michael@0: async BackUpXResources(FileDescriptor aXSocketFd); michael@0: michael@0: intr NPN_UserAgent() michael@0: returns (nsCString userAgent); michael@0: michael@0: intr NPN_GetValue_WithBoolReturn(NPNVariable aVariable) michael@0: returns (NPError aError, michael@0: bool aBoolVal); michael@0: michael@0: // Wake up and process a few native events. Periodically called by michael@0: // Gtk-specific code upon detecting that the plugin process has michael@0: // entered a nested event loop. If the browser doesn't process michael@0: // native events, then "livelock" and some other glitches can occur. michael@0: intr ProcessSomeEvents(); michael@0: michael@0: // OS X Specific calls to manage the plugin's window michael@0: // when interposing system calls. michael@0: async PluginShowWindow(uint32_t aWindowId, bool aModal, michael@0: int32_t aX, int32_t aY, michael@0: size_t aWidth, size_t aHeight); michael@0: async PluginHideWindow(uint32_t aWindowId); michael@0: michael@0: // OS X Specific calls to allow the plugin to manage the cursor. michael@0: async SetCursor(NSCursorInfo cursorInfo); michael@0: async ShowCursor(bool show); michael@0: async PushCursor(NSCursorInfo cursorInfo); michael@0: async PopCursor(); michael@0: sync GetNativeCursorsSupported() returns (bool supported); michael@0: michael@0: sync NPN_SetException(nullable PPluginScriptableObject actor, michael@0: nsCString message); michael@0: michael@0: async NPN_ReloadPlugins(bool aReloadPages); michael@0: }; michael@0: michael@0: } // namespace plugins michael@0: } // namespace mozilla