1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/ipc/PPluginModule.ipdl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,135 @@ 1.4 +/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +include protocol PPluginIdentifier; 1.10 +include protocol PPluginInstance; 1.11 +include protocol PPluginScriptableObject; 1.12 +include protocol PCrashReporter; 1.13 + 1.14 + 1.15 +using NPError from "npapi.h"; 1.16 +using NPNVariable from "npapi.h"; 1.17 +using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h"; 1.18 +using class mac_plugin_interposing::NSCursorInfo from "mozilla/plugins/PluginMessageUtils.h"; 1.19 +using struct nsID from "nsID.h"; 1.20 + 1.21 +namespace mozilla { 1.22 +namespace plugins { 1.23 + 1.24 +intr protocol PPluginModule 1.25 +{ 1.26 + manages PPluginInstance; 1.27 + manages PPluginIdentifier; 1.28 + manages PCrashReporter; 1.29 + 1.30 +both: 1.31 + /** 1.32 + * Sending a void string to this constructor creates an int identifier whereas 1.33 + * sending a non-void string will create a string identifier. This constructor 1.34 + * may be called by either child or parent. If a race occurs by calling the 1.35 + * constructor with the same string or int argument then we create two actors 1.36 + * and detect the second instance in the child. We prevent the parent's actor 1.37 + * from leaking out to plugin code and only allow the child's to be used. 1.38 + * 1.39 + * When calling into the plugin, the parent may create a "temporary" 1.40 + * identifier which is only valid for the lifetime of the current inerrupt frame. 1.41 + */ 1.42 + async PPluginIdentifier(nsCString aString, 1.43 + int32_t aInt, 1.44 + bool temporary); 1.45 + 1.46 + // Window-specific message which instructs the interrupt mechanism to enter 1.47 + // a nested event loop for the current interrupt call. 1.48 + async ProcessNativeEventsInInterruptCall(); 1.49 + 1.50 +child: 1.51 + // Forces the child process to update its plugin function table. 1.52 + intr NP_GetEntryPoints() 1.53 + returns (NPError rv); 1.54 + 1.55 + intr NP_Initialize(uint32_t aFlags) 1.56 + returns (NPError rv); 1.57 + 1.58 + intr PPluginInstance(nsCString aMimeType, 1.59 + uint16_t aMode, 1.60 + nsCString[] aNames, 1.61 + nsCString[] aValues) 1.62 + returns (NPError rv); 1.63 + 1.64 + intr NP_Shutdown() 1.65 + returns (NPError rv); 1.66 + 1.67 + intr OptionalFunctionsSupported() 1.68 + returns (bool aURLRedirectNotify, bool aClearSiteData, 1.69 + bool aGetSitesWithData); 1.70 + 1.71 + intr NPP_ClearSiteData(nsCString site, uint64_t flags, uint64_t maxAge) 1.72 + returns (NPError rv); 1.73 + 1.74 + intr NPP_GetSitesWithData() 1.75 + returns (nsCString[] sites); 1.76 + 1.77 + // Windows specific message to set up an audio session in the plugin process 1.78 + async SetAudioSessionData(nsID aID, 1.79 + nsString aDisplayName, 1.80 + nsString aIconPath); 1.81 + 1.82 + async SetParentHangTimeout(uint32_t seconds); 1.83 + 1.84 + intr PCrashReporter() 1.85 + returns (NativeThreadId tid, uint32_t processType); 1.86 + 1.87 + intr GeckoGetProfile() 1.88 + returns (nsCString aProfile); 1.89 + 1.90 +parent: 1.91 + /** 1.92 + * This message is only used on X11 platforms. 1.93 + * 1.94 + * Send a dup of the plugin process's X socket to the parent 1.95 + * process. In theory, this scheme keeps the plugin's X resources 1.96 + * around until after both the plugin process shuts down *and* the 1.97 + * parent process closes the dup fd. This is used to prevent the 1.98 + * parent process from crashing on X errors if, e.g., the plugin 1.99 + * crashes *just before* a repaint and the parent process tries to 1.100 + * use the newly-invalid surface. 1.101 + */ 1.102 + async BackUpXResources(FileDescriptor aXSocketFd); 1.103 + 1.104 + intr NPN_UserAgent() 1.105 + returns (nsCString userAgent); 1.106 + 1.107 + intr NPN_GetValue_WithBoolReturn(NPNVariable aVariable) 1.108 + returns (NPError aError, 1.109 + bool aBoolVal); 1.110 + 1.111 + // Wake up and process a few native events. Periodically called by 1.112 + // Gtk-specific code upon detecting that the plugin process has 1.113 + // entered a nested event loop. If the browser doesn't process 1.114 + // native events, then "livelock" and some other glitches can occur. 1.115 + intr ProcessSomeEvents(); 1.116 + 1.117 + // OS X Specific calls to manage the plugin's window 1.118 + // when interposing system calls. 1.119 + async PluginShowWindow(uint32_t aWindowId, bool aModal, 1.120 + int32_t aX, int32_t aY, 1.121 + size_t aWidth, size_t aHeight); 1.122 + async PluginHideWindow(uint32_t aWindowId); 1.123 + 1.124 + // OS X Specific calls to allow the plugin to manage the cursor. 1.125 + async SetCursor(NSCursorInfo cursorInfo); 1.126 + async ShowCursor(bool show); 1.127 + async PushCursor(NSCursorInfo cursorInfo); 1.128 + async PopCursor(); 1.129 + sync GetNativeCursorsSupported() returns (bool supported); 1.130 + 1.131 + sync NPN_SetException(nullable PPluginScriptableObject actor, 1.132 + nsCString message); 1.133 + 1.134 + async NPN_ReloadPlugins(bool aReloadPages); 1.135 +}; 1.136 + 1.137 +} // namespace plugins 1.138 +} // namespace mozilla