Merge mozilla-central and tracemonkey. (a=blockers)
[mozilla-central.git] / dom / ipc / PContent.ipdl
blobf26bf8901e5f6e2e70972990190bb86f0f090444
1 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
2 /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
3 /* ***** BEGIN LICENSE BLOCK *****
4  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5  *
6  * The contents of this file are subject to the Mozilla Public License Version
7  * 1.1 (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  * http://www.mozilla.org/MPL/
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is Mozilla Content App.
17  *
18  * The Initial Developer of the Original Code is
19  *   The Mozilla Foundation.
20  * Portions created by the Initial Developer are Copyright (C) 2009
21  * the Initial Developer. All Rights Reserved.
22  *
23  * Contributor(s):
24  *
25  * Alternatively, the contents of this file may be used under the terms of
26  * either the GNU General Public License Version 2 or later (the "GPL"), or
27  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28  * in which case the provisions of the GPL or the LGPL are applicable instead
29  * of those above. If you wish to allow use of your version of this file only
30  * under the terms of either the GPL or the LGPL, and not to allow others to
31  * use your version of this file under the terms of the MPL, indicate your
32  * decision by deleting the provisions above and replace them with the notice
33  * and other provisions required by the GPL or the LGPL. If you do not delete
34  * the provisions above, a recipient may use your version of this file under
35  * the terms of any one of the MPL, the GPL or the LGPL.
36  *
37  * ***** END LICENSE BLOCK ***** */
39 include protocol PAudio;
40 include protocol PBrowser;
41 include protocol PCrashReporter;
42 include protocol PTestShell;
43 include protocol PNecko;
44 include protocol PExternalHelperApp;
45 include protocol PStorage;
47 include "mozilla/chrome/RegistryMessageUtils.h";
48 include "mozilla/net/NeckoMessageUtils.h";
50 include "nsGeoPositionIPCSerialiser.h";
51 include "PPrefTuple.h";
53 using GeoPosition;
54 using PrefTuple;
56 using ChromePackage;
57 using ResourceMapping;
58 using OverrideMapping;
59 using IPC::URI;
60 using IPC::Permission;
61 using mozilla::null_t;
62 using gfxIntSize;
64 namespace mozilla {
65 namespace dom {
67 // Data required to clone an existing DOMStorageImpl in the parent
68 struct StorageClone
70     // Existing cross-process storage actor to clone
71     PStorage actor;
72     // Result of calling IsCallerSecure() in the child
73     bool callerSecure;
76 // When creating a new PStorage protocol, an existing one can be
77 // cloned (see nsDOMStorage2::Clone)
78 union StorageConstructData
80     null_t;
81     StorageClone;
84 rpc protocol PContent
86     manages PAudio;
87     manages PBrowser;
88     manages PCrashReporter;
89     manages PTestShell;
90     manages PNecko;
91     manages PExternalHelperApp;
92     manages PStorage;
94 child:
95     PBrowser(PRUint32 chromeFlags);
97     PTestShell();
99     RegisterChrome(ChromePackage[] packages, ResourceMapping[] resources,
100                    OverrideMapping[] overrides, nsCString locale);
102     async SetOffline(PRBool offline);
104     async NotifyVisited(URI uri);
106     PreferenceUpdate(PrefTuple pref);
107     ClearUserPreference(nsCString prefName);
109     NotifyAlertsObserver(nsCString topic, nsString data);
111     GeolocationUpdate(GeoPosition somewhere);
113     // nsIPermissionManager messages
114     AddPermission(Permission permission);
116     AccelerationChanged(double x, double y, double z);
118     ScreenSizeChanged(gfxIntSize size);
120     FlushMemory(nsString reason);
122 parent:
123     PNecko();
124     PCrashReporter();
125     
126     PStorage(StorageConstructData data);
128     PAudio(PRInt32 aNumChannels, PRInt32 aRate, PRInt32 aFormat);
130     // Services remoting
132     async StartVisitedQuery(URI uri);
133     async VisitURI(URI uri, URI referrer, PRUint32 flags);
134     async SetURITitle(URI uri, nsString title);
135     
136     // filepicker remoting
137     sync ShowFilePicker(PRInt16 mode, PRInt16 selectedType, 
138                         nsString title, nsString defaultFile, nsString defaultExtension,
139                         nsString[] filters, nsString[] filterNames)
140         returns (nsString[] files, PRInt16 retValue, nsresult result);
142     async LoadURIExternal(URI uri);
144     // PrefService message
145     sync ReadPrefsArray() returns (PrefTuple[] retValue);
147     sync SyncMessage(nsString aMessage, nsString aJSON)
148       returns (nsString[] retval);
150     ShowAlertNotification(nsString imageUrl, 
151                           nsString title, 
152                           nsString text, 
153                           PRBool textClickable,
154                           nsString cookie,
155                           nsString name);
157     PExternalHelperApp(URI uri, nsCString aMimeContentType,
158                        nsCString aContentDisposition, bool aForceSave,
159                        PRInt64 aContentLength, URI aReferrer);
160     
161     AddGeolocationListener();
162     RemoveGeolocationListener();
163     AddAccelerometerListener();
164     RemoveAccelerometerListener();
166     ConsoleMessage(nsString message);
167     ScriptError(nsString message, nsString sourceName, nsString sourceLine,
168                 PRUint32 lineNumber, PRUint32 colNumber, PRUint32 flags,
169                 nsCString category); 
171     // nsIPermissionManager messages
172     sync ReadPermissions() returns (Permission[] permissions);
174 both:
175      AsyncMessage(nsString aMessage, nsString aJSON);