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