Merge mozilla-central and tracemonkey. (a=blockers)
[mozilla-central.git] / dom / plugins / PPluginModule.ipdl
blob7619a843bcbdcd3d20adf5bb464c1ce437cef047
1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4  *
5  * The contents of this file are subject to the Mozilla Public License Version
6  * 1.1 (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  * http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12  * for the specific language governing rights and limitations under the
13  * License.
14  *
15  * The Original Code is Mozilla Plugins.
16  *
17  * The Initial Developer of the Original Code is
18  *   Chris Jones <jones.chris.g@gmail.com>.
19  * Portions created by the Initial Developer are Copyright (C) 2009
20  * the Initial Developer. All Rights Reserved.
21  *
22  * Contributor(s):
23  *   Benjamin Smedberg <benjamin@smedbergs.us>
24  *   Ben Turner <bent.mozilla@gmail.com>
25  *
26  * Alternatively, the contents of this file may be used under the terms of
27  * either the GNU General Public License Version 2 or later (the "GPL"), or
28  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29  * in which case the provisions of the GPL or the LGPL are applicable instead
30  * of those above. If you wish to allow use of your version of this file only
31  * under the terms of either the GPL or the LGPL, and not to allow others to
32  * use your version of this file under the terms of the MPL, indicate your
33  * decision by deleting the provisions above and replace them with the notice
34  * and other provisions required by the GPL or the LGPL. If you do not delete
35  * the provisions above, a recipient may use your version of this file under
36  * the terms of any one of the MPL, the GPL or the LGPL.
37  *
38  * ***** END LICENSE BLOCK ***** */
40 include protocol PPluginIdentifier;
41 include protocol PPluginInstance;
43 include "npapi.h";
44 include "mozilla/plugins/PluginMessageUtils.h";
46 using NPError;
47 using NPNVariable;
48 using base::FileDescriptor;
49 using mozilla::plugins::NativeThreadId;
51 namespace mozilla {
52 namespace plugins {
54 rpc protocol PPluginModule
56   manages PPluginInstance;
57   manages PPluginIdentifier;
59 both:
60   /**
61    * Sending a void string to this constructor creates an int identifier whereas
62    * sending a non-void string will create a string identifier. This constructor
63    * may be called by either child or parent. If a race occurs by calling the
64    * constructor with the same string or int argument then we create two actors
65    * and detect the second instance in the child. We prevent the parent's actor
66    * from leaking out to plugin code and only allow the child's to be used.
67    */
68   async PPluginIdentifier(nsCString aString,
69                           int32_t aInt);
71 child:
72   // Forces the child process to update its plugin function table.
73   rpc NP_GetEntryPoints()
74     returns (NPError rv);
76   // Return the plugin's thread ID, if it can be found.
77   rpc NP_Initialize()
78     returns (NativeThreadId tid, NPError rv);
80   rpc PPluginInstance(nsCString aMimeType,
81                       uint16_t aMode,
82                       nsCString[] aNames,
83                       nsCString[] aValues)
84     returns (NPError rv);
86   rpc NP_Shutdown()
87     returns (NPError rv);
89   rpc OptionalFunctionsSupported()
90     returns (bool aURLRedirectNotify, bool aClearSiteData,
91              bool aGetSitesWithData);
93   rpc NPP_ClearSiteData(nsCString site, uint64_t flags, uint64_t maxAge)
94     returns (NPError rv);
96   rpc NPP_GetSitesWithData()
97     returns (nsCString[] sites);
99 parent:
100   /**
101    * This message is only used on X11 platforms.
102    *
103    * Send a dup of the plugin process's X socket to the parent
104    * process.  In theory, this scheme keeps the plugin's X resources
105    * around until after both the plugin process shuts down *and* the
106    * parent process closes the dup fd.  This is used to prevent the
107    * parent process from crashing on X errors if, e.g., the plugin
108    * crashes *just before* a repaint and the parent process tries to
109    * use the newly-invalid surface.
110    */
111   async BackUpXResources(FileDescriptor aXSocketFd);
113   rpc NPN_UserAgent()
114     returns (nsCString userAgent);
116   rpc NPN_GetValue_WithBoolReturn(NPNVariable aVariable)
117     returns (NPError aError,
118              bool aBoolVal);
120   // Wake up and process a few native events.  Periodically called by
121   // Gtk-specific code upon detecting that the plugin process has
122   // entered a nested event loop.  If the browser doesn't process
123   // native events, then "livelock" and some other glitches can occur.
124   rpc ProcessSomeEvents();
126   // Window-specific message which instructs the RPC mechanism to enter
127   // a nested event loop for the current RPC call.
128   async ProcessNativeEventsInRPCCall();
130   sync AppendNotesToCrashReport(nsCString aNotes);
132   // OS X Specific calls to manage the plugin's window
133   // when interposing system calls.
134   async PluginShowWindow(uint32_t aWindowId, bool aModal,
135                          int32_t aX, int32_t aY,
136                          size_t aWidth, size_t aHeight);
137   async PluginHideWindow(uint32_t aWindowId);
140 } // namespace plugins
141 } // namespace mozilla