dom/plugins/ipc/PPluginModule.ipdl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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";
    18 namespace mozilla {
    19 namespace plugins {
    21 intr protocol PPluginModule
    22 {
    23   manages PPluginInstance;
    24   manages PPluginIdentifier;
    25   manages PCrashReporter;
    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);
    43   // Window-specific message which instructs the interrupt mechanism to enter
    44   // a nested event loop for the current interrupt call.
    45   async ProcessNativeEventsInInterruptCall();
    47 child:
    48   // Forces the child process to update its plugin function table.
    49   intr NP_GetEntryPoints()
    50     returns (NPError rv);
    52   intr NP_Initialize(uint32_t aFlags)
    53     returns (NPError rv);
    55   intr PPluginInstance(nsCString aMimeType,
    56                       uint16_t aMode,
    57                       nsCString[] aNames,
    58                       nsCString[] aValues)
    59     returns (NPError rv);
    61   intr NP_Shutdown()
    62     returns (NPError rv);
    64   intr OptionalFunctionsSupported()
    65     returns (bool aURLRedirectNotify, bool aClearSiteData,
    66              bool aGetSitesWithData);
    68   intr NPP_ClearSiteData(nsCString site, uint64_t flags, uint64_t maxAge)
    69     returns (NPError rv);
    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,
    77                             nsString aIconPath);
    79   async SetParentHangTimeout(uint32_t seconds);
    81   intr PCrashReporter()
    82     returns (NativeThreadId tid, uint32_t processType);
    84   intr GeckoGetProfile()
    85     returns (nsCString aProfile);
    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);
   101   intr NPN_UserAgent()
   102     returns (nsCString userAgent);
   104   intr NPN_GetValue_WithBoolReturn(NPNVariable aVariable)
   105     returns (NPError aError,
   106              bool aBoolVal);
   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);
   125   async PopCursor();
   126   sync GetNativeCursorsSupported() returns (bool supported);
   128   sync NPN_SetException(nullable PPluginScriptableObject actor,
   129                         nsCString message);
   131   async NPN_ReloadPlugins(bool aReloadPages);
   132 };
   134 } // namespace plugins
   135 } // namespace mozilla

mercurial