PContent.ipdl 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  1. /* -*- Mode: C++; c-basic-offset: 4; 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/. */
  5. include protocol PBackground;
  6. include protocol PBlob;
  7. include protocol PBrowser;
  8. include protocol PCompositorBridge;
  9. include protocol PContentBridge;
  10. include protocol PContentPermissionRequest;
  11. include protocol PCycleCollectWithLogs;
  12. include protocol PPSMContentDownloader;
  13. include protocol PExternalHelperApp;
  14. include protocol PHandlerService;
  15. include protocol PFileDescriptorSet;
  16. include protocol PHal;
  17. include protocol PHeapSnapshotTempFileHelper;
  18. include protocol PProcessHangMonitor;
  19. include protocol PImageBridge;
  20. include protocol PMedia;
  21. include protocol PMemoryReportRequest;
  22. include protocol PNecko;
  23. // FIXME This is pretty ridiculous, but we have to keep the order of the
  24. // following 4 includes, or the parser is confused about PGMPContent
  25. // bridging PContent and PGMP. As soon as it registers the bridge between
  26. // PContent and PPluginModule it seems to think that PContent's parent and
  27. // child live in the same process!
  28. include protocol PGMPContent;
  29. include protocol PGMPService;
  30. include protocol PPluginModule;
  31. include protocol PGMP;
  32. include protocol PPrinting;
  33. include protocol PSendStream;
  34. include protocol POfflineCacheUpdate;
  35. include protocol PRenderFrame;
  36. include protocol PScreenManager;
  37. include protocol PSpeechSynthesis;
  38. include protocol PStorage;
  39. include protocol PTestShell;
  40. include protocol PJavaScript;
  41. include protocol PRemoteSpellcheckEngine;
  42. include protocol PWebBrowserPersistDocument;
  43. include protocol PWebrtcGlobal;
  44. include protocol PVideoDecoderManager;
  45. include DOMTypes;
  46. include JavaScriptTypes;
  47. include InputStreamParams;
  48. include PTabContext;
  49. include URIParams;
  50. include PluginTypes;
  51. include ProtocolTypes;
  52. include PBackgroundSharedTypes;
  53. include PContentPermission;
  54. include ServiceWorkerConfiguration;
  55. include GraphicsMessages;
  56. include ProfilerTypes;
  57. // Workaround to prevent error if PContentChild.cpp & PContentBridgeParent.cpp
  58. // are put into different UnifiedProtocolsXX.cpp files.
  59. // XXX Remove this once bug 1069073 is fixed
  60. include "mozilla/dom/PContentBridgeParent.h";
  61. using GeoPosition from "nsGeoPositionIPCSerialiser.h";
  62. using AlertNotificationType from "mozilla/AlertNotificationIPCSerializer.h";
  63. using struct ChromePackage from "mozilla/chrome/RegistryMessageUtils.h";
  64. using struct SubstitutionMapping from "mozilla/chrome/RegistryMessageUtils.h";
  65. using struct OverrideMapping from "mozilla/chrome/RegistryMessageUtils.h";
  66. using base::ChildPrivileges from "base/process_util.h";
  67. using base::ProcessId from "base/process.h";
  68. using struct IPC::Permission from "mozilla/net/NeckoMessageUtils.h";
  69. using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";
  70. using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
  71. using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
  72. using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
  73. using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
  74. using mozilla::gfx::IntSize from "mozilla/gfx/2D.h";
  75. using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
  76. using mozilla::dom::ContentParentId from "mozilla/dom/ipc/IdType.h";
  77. using mozilla::LayoutDeviceIntPoint from "Units.h";
  78. using struct LookAndFeelInt from "mozilla/widget/WidgetMessageUtils.h";
  79. using class mozilla::dom::MessagePort from "mozilla/dom/MessagePort.h";
  80. using class mozilla::dom::ipc::StructuredCloneData from "mozilla/dom/ipc/StructuredCloneData.h";
  81. using mozilla::DataStorageType from "ipc/DataStorageIPCUtils.h";
  82. using mozilla::DocShellOriginAttributes from "mozilla/ipc/BackgroundUtils.h";
  83. using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
  84. union ChromeRegistryItem
  85. {
  86. ChromePackage;
  87. OverrideMapping;
  88. SubstitutionMapping;
  89. };
  90. namespace mozilla {
  91. namespace dom {
  92. struct FontListEntry {
  93. nsString familyName;
  94. nsString faceName;
  95. nsCString filepath;
  96. uint16_t weight;
  97. int16_t stretch;
  98. uint8_t italic;
  99. uint8_t index;
  100. bool isHidden;
  101. };
  102. union PrefValue {
  103. nsCString;
  104. int32_t;
  105. bool;
  106. };
  107. union MaybePrefValue {
  108. PrefValue;
  109. null_t;
  110. };
  111. struct PrefSetting {
  112. nsCString name;
  113. MaybePrefValue defaultValue;
  114. MaybePrefValue userValue;
  115. };
  116. struct DataStorageItem {
  117. nsCString key;
  118. nsCString value;
  119. DataStorageType type;
  120. };
  121. // Note: Any changes to this structure should also be changed in
  122. // FileSystemUpdate below.
  123. struct VolumeInfo {
  124. nsString name;
  125. nsString mountPoint;
  126. int32_t volState;
  127. int32_t mountGeneration;
  128. bool isMediaPresent;
  129. bool isSharing;
  130. bool isFormatting;
  131. bool isFake;
  132. bool isUnmounting;
  133. bool isRemovable;
  134. bool isHotSwappable;
  135. };
  136. struct ClipboardCapabilities {
  137. bool supportsSelectionClipboard;
  138. bool supportsFindClipboard;
  139. };
  140. union MaybeFileDesc {
  141. FileDescriptor;
  142. void_t;
  143. };
  144. union FileDescOrError {
  145. FileDescriptor;
  146. nsresult;
  147. };
  148. struct DomainPolicyClone
  149. {
  150. bool active;
  151. URIParams[] blacklist;
  152. URIParams[] whitelist;
  153. URIParams[] superBlacklist;
  154. URIParams[] superWhitelist;
  155. };
  156. struct FrameScriptInfo
  157. {
  158. nsString url;
  159. bool runInGlobalScope;
  160. };
  161. struct AndroidSystemInfo
  162. {
  163. nsString device;
  164. nsString manufacturer;
  165. nsString release_version;
  166. nsString hardware;
  167. uint32_t sdk_version;
  168. bool isTablet;
  169. };
  170. struct GetFilesResponseSuccess
  171. {
  172. PBlob[] blobs;
  173. };
  174. struct GetFilesResponseFailure
  175. {
  176. nsresult errorCode;
  177. };
  178. union GetFilesResponseResult
  179. {
  180. GetFilesResponseSuccess;
  181. GetFilesResponseFailure;
  182. };
  183. struct BlobURLRegistrationData
  184. {
  185. nsCString url;
  186. PBlob blob;
  187. Principal principal;
  188. };
  189. struct GMPAPITags
  190. {
  191. nsCString api;
  192. nsCString[] tags;
  193. };
  194. struct GMPCapabilityData
  195. {
  196. nsCString name;
  197. nsCString version;
  198. GMPAPITags[] capabilities;
  199. };
  200. nested(upto inside_cpow) sync protocol PContent
  201. {
  202. parent spawns PPluginModule;
  203. parent opens PProcessHangMonitor;
  204. parent opens PGMPService;
  205. child opens PBackground;
  206. manages PBlob;
  207. manages PBrowser;
  208. manages PContentPermissionRequest;
  209. manages PCycleCollectWithLogs;
  210. manages PPSMContentDownloader;
  211. manages PExternalHelperApp;
  212. manages PFileDescriptorSet;
  213. manages PHal;
  214. manages PHandlerService;
  215. manages PHeapSnapshotTempFileHelper;
  216. manages PMedia;
  217. manages PMemoryReportRequest;
  218. manages PNecko;
  219. manages POfflineCacheUpdate;
  220. manages PPrinting;
  221. manages PSendStream;
  222. manages PScreenManager;
  223. manages PSpeechSynthesis;
  224. manages PStorage;
  225. manages PTestShell;
  226. manages PJavaScript;
  227. manages PRemoteSpellcheckEngine;
  228. manages PWebBrowserPersistDocument;
  229. manages PWebrtcGlobal;
  230. both:
  231. // Depending on exactly how the new browser is being created, it might be
  232. // created from either the child or parent process!
  233. //
  234. // The child creates the PBrowser as part of
  235. // TabChild::BrowserFrameProvideWindow (which happens when the child's
  236. // content calls window.open()), and the parent creates the PBrowser as part
  237. // of ContentParent::CreateBrowserOrApp.
  238. //
  239. // When the parent constructs a PBrowser, the child trusts the app token and
  240. // other attributes it receives from the parent. In that case, the
  241. // context should be FrameIPCTabContext.
  242. //
  243. // When the child constructs a PBrowser, the parent doesn't trust the app
  244. // token it receives from the child. In this case, context must have type
  245. // PopupIPCTabContext. The browser created using a PopupIPCTabContext has
  246. // the opener PBrowser's app-id and containing-app-id. The parent checks
  247. // that if the opener is a browser element, the context is also for a
  248. // browser element.
  249. //
  250. // This allows the parent to prevent a malicious child from escalating its
  251. // privileges by requesting a PBrowser corresponding to a highly-privileged
  252. // app; the child can only request privileges for an app which the child has
  253. // access to (in the form of a TabChild).
  254. //
  255. // Keep the last 3 attributes in sync with GetProcessAttributes!
  256. async PBrowser(TabId tabId, IPCTabContext context, uint32_t chromeFlags,
  257. ContentParentId cpId, bool isForApp, bool isForBrowser);
  258. async PBlob(BlobConstructorParams params);
  259. async PFileDescriptorSet(FileDescriptor fd);
  260. // For parent->child, aBrowser must be non-null; aOuterWindowID can
  261. // be 0 to indicate the browser's current root document, or nonzero
  262. // to persist a subdocument. For child->parent, arguments are
  263. // ignored and should be null/zero.
  264. async PWebBrowserPersistDocument(nullable PBrowser aBrowser,
  265. uint64_t aOuterWindowID);
  266. child:
  267. // Give the content process its endpoints to the compositor.
  268. async InitRendering(
  269. Endpoint<PCompositorBridgeChild> compositor,
  270. Endpoint<PImageBridgeChild> imageBridge,
  271. Endpoint<PVideoDecoderManagerChild> video);
  272. // Re-create the rendering stack using the given endpoints. This is sent
  273. // after the compositor process has crashed. The new endpoints may be to a
  274. // newly launched GPU process, or the compositor thread of the UI process.
  275. async ReinitRendering(
  276. Endpoint<PCompositorBridgeChild> compositor,
  277. Endpoint<PImageBridgeChild> bridge,
  278. Endpoint<PVideoDecoderManagerChild> video);
  279. /**
  280. * Enable system-level sandboxing features, if available. Can
  281. * usually only be performed zero or one times. The child may
  282. * abnormally exit if this fails; the details are OS-specific.
  283. */
  284. async SetProcessSandbox(MaybeFileDesc aBroker);
  285. async PMemoryReportRequest(uint32_t generation, bool anonymize,
  286. bool minimizeMemoryUsage, MaybeFileDesc DMDFile);
  287. /**
  288. * Sent to notify that aTabId has been allocated aLayersId
  289. */
  290. async NotifyLayerAllocated(TabId aTabId, uint64_t aLayersId);
  291. async SpeakerManagerNotify();
  292. /**
  293. * Communication between the PuppetBidiKeyboard and the actual
  294. * BidiKeyboard hosted by the parent
  295. */
  296. async BidiKeyboardNotify(bool isLangRTL, bool haveBidiKeyboards);
  297. /**
  298. * Dump this process's GC and CC logs to the provided files.
  299. *
  300. * For documentation on the other args, see dumpGCAndCCLogsToFile in
  301. * nsIMemoryInfoDumper.idl
  302. */
  303. async PCycleCollectWithLogs(bool dumpAllTraces,
  304. FileDescriptor gcLog,
  305. FileDescriptor ccLog);
  306. async PTestShell();
  307. async RegisterChrome(ChromePackage[] packages, SubstitutionMapping[] substitutions,
  308. OverrideMapping[] overrides, nsCString locale, bool reset);
  309. async RegisterChromeItem(ChromeRegistryItem item);
  310. async ClearImageCache(bool privateLoader, bool chrome);
  311. async SetOffline(bool offline);
  312. async SetConnectivity(bool connectivity);
  313. async SetCaptivePortalState(int32_t aState);
  314. async NotifyVisited(URIParams uri);
  315. async PreferenceUpdate(PrefSetting pref);
  316. async VarUpdate(GfxVarUpdate var);
  317. async DataStoragePut(nsString aFilename, DataStorageItem aItem);
  318. async DataStorageRemove(nsString aFilename, nsCString aKey, DataStorageType aType);
  319. async DataStorageClear(nsString aFilename);
  320. async NotifyAlertsObserver(nsCString topic, nsString data);
  321. async GeolocationUpdate(GeoPosition somewhere);
  322. async GeolocationError(uint16_t errorCode);
  323. async UpdateDictionaryList(nsString[] dictionaries);
  324. // nsIPermissionManager messages
  325. async AddPermission(Permission permission);
  326. async Volumes(VolumeInfo[] volumes);
  327. async FlushMemory(nsString reason);
  328. async GarbageCollect();
  329. async CycleCollect();
  330. /**
  331. * Start accessibility engine in content process.
  332. * @param aMsaaID is an a11y-specific unique id for the content process
  333. * that is generated by the chrome process. Only used on
  334. * Windows; pass 0 on other platforms.
  335. */
  336. async ActivateA11y(uint32_t aMsaaID);
  337. /**
  338. * Shutdown accessibility engine in content process (if not in use).
  339. */
  340. async ShutdownA11y();
  341. async AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName,
  342. nsCString ID, nsCString vendor);
  343. async AppInit();
  344. /**
  345. * Send ServiceWorkerRegistrationData to child process.
  346. */
  347. async InitServiceWorkers(ServiceWorkerConfiguration aConfig);
  348. /**
  349. * Send BlobURLRegistrationData to child process.
  350. */
  351. async InitBlobURLs(BlobURLRegistrationData[] registrations);
  352. // Notify child that last-pb-context-exited notification was observed
  353. async LastPrivateDocShellDestroyed();
  354. // Note: Any changes to this structure should also be changed in
  355. // VolumeInfo above.
  356. async FileSystemUpdate(nsString fsName, nsString mountPoint, int32_t fsState,
  357. int32_t mountGeneration, bool isMediaPresent,
  358. bool isSharing, bool isFormatting, bool isFake,
  359. bool isUnmounting, bool isRemovable, bool isHotSwappable);
  360. // Notify volume is removed.
  361. async VolumeRemoved(nsString fsName);
  362. async NotifyProcessPriorityChanged(ProcessPriority priority);
  363. async MinimizeMemoryUsage();
  364. /**
  365. * Used to manage nsIStyleSheetService across processes.
  366. */
  367. async LoadAndRegisterSheet(URIParams uri, uint32_t type);
  368. async UnregisterSheet(URIParams uri, uint32_t type);
  369. async NotifyPhoneStateChange(nsString newState);
  370. /**
  371. * Notify idle observers in the child
  372. */
  373. async NotifyIdleObserver(uint64_t observerId, nsCString topic, nsString str);
  374. /**
  375. * Called during plugin initialization to map a plugin id to a child process
  376. * id.
  377. */
  378. async AssociatePluginId(uint32_t aPluginId, ProcessId aProcessId);
  379. /**
  380. * This call is used by async plugin initialization to notify the
  381. * PluginModuleContentParent that the PluginModuleChromeParent's async
  382. * init has completed.
  383. */
  384. async LoadPluginResult(uint32_t aPluginId, bool aResult);
  385. async InvokeDragSession(IPCDataTransfer[] transfers, uint32_t action);
  386. async EndDragSession(bool aDoneDrag, bool aUserCancelled,
  387. LayoutDeviceIntPoint aDragEndPoint);
  388. async DomainSetChanged(uint32_t aSetType, uint32_t aChangeType, OptionalURIParams aDomain);
  389. /**
  390. * Notify the child to shutdown. The child will in turn call FinishShutdown
  391. * and let the parent close the channel.
  392. */
  393. async Shutdown();
  394. async LoadProcessScript(nsString url);
  395. /**
  396. * Requests a full native update of a native plugin child window. This is
  397. * a Windows specific call.
  398. */
  399. async UpdateWindow(uintptr_t aChildId);
  400. /**
  401. * Notify the child that cache is emptied.
  402. */
  403. async NotifyEmptyHTTPCache();
  404. /**
  405. * Send a `push` event without data to a service worker in the child.
  406. */
  407. async Push(nsCString scope, Principal principal, nsString messageId);
  408. /**
  409. * Send a `push` event with data to a service worker in the child.
  410. */
  411. async PushWithData(nsCString scope, Principal principal,
  412. nsString messageId, uint8_t[] data);
  413. /**
  414. * Send a `pushsubscriptionchange` event to a service worker in the child.
  415. */
  416. async PushSubscriptionChange(nsCString scope, Principal principal);
  417. /**
  418. * Send a Push error message to all service worker clients in the child.
  419. */
  420. async PushError(nsCString scope, Principal principal, nsString message,
  421. uint32_t flags);
  422. /**
  423. * Windows specific: associate this content process with the browsers
  424. * audio session.
  425. */
  426. async SetAudioSessionData(nsID aID,
  427. nsString aDisplayName,
  428. nsString aIconPath);
  429. async GetFilesResponse(nsID aID, GetFilesResponseResult aResult);
  430. async BlobURLRegistration(nsCString aURI, PBlob aBlob,
  431. Principal aPrincipal);
  432. async BlobURLUnregistration(nsCString aURI);
  433. async GMPsChanged(GMPCapabilityData[] capabilities);
  434. parent:
  435. /**
  436. * Tell the content process some attributes of itself. This is
  437. * among the first information queried by content processes after
  438. * startup. (The message is sync to allow the content process to
  439. * control when it receives the information.)
  440. *
  441. * |id| is a unique ID among all subprocesses. When |isForApp &&
  442. * isForBrowser|, we're loading <browser> for an app. When
  443. * |isForBrowser|, we're loading <browser>. When |!isForApp &&
  444. * !isForBrowser|, we're probably loading <xul:browser remote>.
  445. *
  446. * Keep the return values in sync with PBrowser()!
  447. */
  448. sync GetProcessAttributes()
  449. returns (ContentParentId cpId, bool isForApp, bool isForBrowser);
  450. sync GetXPCOMProcessAttributes()
  451. returns (bool isOffline, bool isConnected, int32_t captivePortalState,
  452. bool isLangRTL,
  453. bool haveBidiKeyboards, nsString[] dictionaries,
  454. ClipboardCapabilities clipboardCaps,
  455. DomainPolicyClone domainPolicy,
  456. StructuredCloneData initialData,
  457. OptionalURIParams userContentSheetURL);
  458. sync CreateChildProcess(IPCTabContext context,
  459. ProcessPriority priority,
  460. TabId openerTabId)
  461. returns (ContentParentId cpId, bool isForApp, bool isForBrowser, TabId tabId);
  462. sync BridgeToChildProcess(ContentParentId cpId);
  463. async CreateGMPService();
  464. /**
  465. * This call connects the content process to a plugin process. While this
  466. * call runs, a new PluginModuleParent will be created in the ContentChild
  467. * via bridging. The corresponding PluginModuleChild will live in the plugin
  468. * process.
  469. */
  470. sync LoadPlugin(uint32_t aPluginId) returns (nsresult aResult, uint32_t aRunID);
  471. /**
  472. * This call is used by asynchronous plugin instantiation to notify the
  473. * content parent that it is now safe to initiate the plugin bridge for
  474. * the specified plugin id. When this call returns, the requested bridge
  475. * connection has been made.
  476. */
  477. sync ConnectPluginBridge(uint32_t aPluginId) returns (nsresult rv);
  478. /**
  479. * Return the current blocklist state for a particular plugin.
  480. */
  481. sync GetBlocklistState(uint32_t aPluginId) returns (uint32_t aState);
  482. /**
  483. * This call returns the set of plugins loaded in the chrome
  484. * process. However, in many cases this set will not have changed since the
  485. * last FindPlugins message. Consequently, the chrome process increments an
  486. * epoch number every time the set of plugins changes. The content process
  487. * sends up the last epoch it observed. If the epochs are the same, the
  488. * chrome process returns no plugins. Otherwise it returns a complete list.
  489. *
  490. * |pluginEpoch| is the epoch last observed by the content
  491. * process. |newPluginEpoch| is the current epoch in the chrome process. If
  492. * |pluginEpoch == newPluginEpoch|, then |plugins| will be left empty.
  493. */
  494. sync FindPlugins(uint32_t pluginEpoch) returns (nsresult aResult, PluginTag[] plugins, uint32_t newPluginEpoch);
  495. async PJavaScript();
  496. async PRemoteSpellcheckEngine();
  497. /**
  498. * Is this token compatible with the provided version?
  499. *
  500. * |version| The offered version to test
  501. * Returns |True| if the offered version is compatible
  502. */
  503. sync NSSU2FTokenIsCompatibleVersion(nsString version)
  504. returns (bool result);
  505. /**
  506. * Return whether the provided KeyHandle belongs to this Token
  507. *
  508. * |keyHandle| Key Handle to evaluate.
  509. * Returns |True| if the Key Handle is ours.
  510. */
  511. sync NSSU2FTokenIsRegistered(uint8_t[] keyHandle)
  512. returns (bool isValidKeyHandle);
  513. /**
  514. * Generates a public/private keypair for the provided application
  515. * and challenge, returning the pubkey, challenge response, and
  516. * key handle in the registration data.
  517. *
  518. * |application| The FIDO Application data to associate with the key.
  519. * |challenge| The Challenge to satisfy in the response.
  520. * |registration| An array containing the pubkey, challenge response,
  521. * and key handle.
  522. */
  523. sync NSSU2FTokenRegister(uint8_t[] application, uint8_t[] challenge)
  524. returns (uint8_t[] registration);
  525. /**
  526. * Creates a signature over the "param" arguments using the private key
  527. * provided in the key handle argument.
  528. *
  529. * |application| The FIDO Application data to associate with the key.
  530. * |challenge| The Challenge to satisfy in the response.
  531. * |keyHandle| The Key Handle opaque object to use.
  532. * |signature| The resulting signature.
  533. */
  534. sync NSSU2FTokenSign(uint8_t[] application, uint8_t[] challenge,
  535. uint8_t[] keyHandle)
  536. returns (uint8_t[] signature);
  537. sync IsSecureURI(uint32_t type, URIParams uri, uint32_t flags)
  538. returns (bool isSecureURI);
  539. sync GetLookAndFeelCache()
  540. returns (LookAndFeelInt[] lookAndFeelIntCache);
  541. nested(inside_cpow) async PHal();
  542. async PHeapSnapshotTempFileHelper();
  543. async PNecko();
  544. async PPrinting();
  545. async PSendStream();
  546. nested(inside_sync) sync PScreenManager()
  547. returns (uint32_t numberOfScreens,
  548. float systemDefaultScale,
  549. bool success);
  550. async PSpeechSynthesis();
  551. nested(inside_cpow) async PStorage();
  552. async PMedia();
  553. async PWebrtcGlobal();
  554. // Services remoting
  555. async StartVisitedQuery(URIParams uri);
  556. async VisitURI(URIParams uri, OptionalURIParams referrer, uint32_t flags);
  557. async SetURITitle(URIParams uri, nsString title);
  558. async LoadURIExternal(URIParams uri, PBrowser windowContext);
  559. async ExtProtocolChannelConnectParent(uint32_t registrarId);
  560. // PrefService message
  561. sync ReadPrefsArray() returns (PrefSetting[] prefs) verify;
  562. sync GetGfxVars() returns (GfxVarUpdate[] vars);
  563. sync ReadFontList() returns (FontListEntry[] retValue);
  564. sync ReadDataStorageArray(nsString aFilename)
  565. returns (DataStorageItem[] retValue);
  566. sync SyncMessage(nsString aMessage, ClonedMessageData aData,
  567. CpowEntry[] aCpows, Principal aPrincipal)
  568. returns (StructuredCloneData[] retval);
  569. nested(inside_sync) sync RpcMessage(nsString aMessage, ClonedMessageData aData,
  570. CpowEntry[] aCpows, Principal aPrincipal)
  571. returns (StructuredCloneData[] retval);
  572. async ShowAlert(AlertNotificationType alert);
  573. async CloseAlert(nsString name, Principal principal);
  574. async DisableNotifications(Principal principal);
  575. async OpenNotificationSettings(Principal principal);
  576. async PPSMContentDownloader(uint32_t aCertType);
  577. async PExternalHelperApp(OptionalURIParams uri,
  578. nsCString aMimeContentType,
  579. nsCString aContentDisposition,
  580. uint32_t aContentDispositionHint,
  581. nsString aContentDispositionFilename,
  582. bool aForceSave,
  583. int64_t aContentLength,
  584. bool aWasFileChannel,
  585. OptionalURIParams aReferrer,
  586. nullable PBrowser aBrowser);
  587. async PHandlerService();
  588. async AddGeolocationListener(Principal principal, bool highAccuracy);
  589. async RemoveGeolocationListener();
  590. async SetGeolocationHigherAccuracy(bool enable);
  591. async ConsoleMessage(nsString message);
  592. async ScriptError(nsString message, nsString sourceName, nsString sourceLine,
  593. uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
  594. nsCString category);
  595. // nsIPermissionManager messages
  596. sync ReadPermissions() returns (Permission[] permissions);
  597. // Places the items within dataTransfer on the clipboard.
  598. async SetClipboard(IPCDataTransfer aDataTransfer,
  599. bool aIsPrivateData,
  600. Principal aRequestingPrincipal,
  601. int32_t aWhichClipboard);
  602. // Given a list of supported types, returns the clipboard data for the
  603. // first type that matches.
  604. sync GetClipboard(nsCString[] aTypes, int32_t aWhichClipboard)
  605. returns (IPCDataTransfer dataTransfer);
  606. // Clears the clipboard.
  607. async EmptyClipboard(int32_t aWhichClipboard);
  608. // Returns true if data of one of the specified types is on the clipboard.
  609. sync ClipboardHasType(nsCString[] aTypes, int32_t aWhichClipboard)
  610. returns (bool hasType);
  611. sync GetSystemColors(uint32_t colorsCount)
  612. returns (uint32_t[] colors);
  613. sync GetIconForExtension(nsCString aFileExt, uint32_t aIconSize)
  614. returns (uint8_t[] bits);
  615. sync GetShowPasswordSetting()
  616. returns (bool showPassword);
  617. // Notify the parent of the presence or absence of private docshells
  618. async PrivateDocShellsExist(bool aExist);
  619. // Tell the parent that the child has gone idle for the first time
  620. async FirstIdle();
  621. async AudioChannelServiceStatus(bool aActiveTelephonyChannel,
  622. bool aContentOrNormalChannel,
  623. bool aAnyActiveChannel);
  624. async AudioChannelChangeDefVolChannel(int32_t aChannel, bool aHidden);
  625. // called by the child (test code only) to propagate volume changes to the parent
  626. async CreateFakeVolume(nsString fsName, nsString mountPoint);
  627. async SetFakeVolumeState(nsString fsName, int32_t fsState);
  628. async RemoveFakeVolume(nsString fsName);
  629. sync KeywordToURI(nsCString keyword)
  630. returns (nsString providerName, OptionalInputStreamParams postData, OptionalURIParams uri);
  631. sync NotifyKeywordSearchLoading(nsString providerName, nsString keyword);
  632. async CopyFavicon(URIParams oldURI, URIParams newURI, Principal aLoadingPrincipal, bool isPrivate);
  633. // Tell the compositor to allocate a layer tree id for nested remote mozbrowsers.
  634. sync AllocateLayerTreeId(ContentParentId cpId, TabId tabId)
  635. returns (uint64_t id);
  636. async DeallocateLayerTreeId(uint64_t id);
  637. sync SpeakerManagerForceSpeaker(bool aEnable);
  638. sync SpeakerManagerGetSpeakerStatus()
  639. returns (bool value);
  640. /**
  641. * Notifies the parent about a recording device is starting or shutdown.
  642. * @param recordingStatus starting or shutdown
  643. * @param pageURL URL that request that changing the recording status
  644. * @param isAudio recording start with microphone
  645. * @param isVideo recording start with camera
  646. */
  647. async RecordingDeviceEvents(nsString recordingStatus,
  648. nsString pageURL,
  649. bool isAudio,
  650. bool isVideo);
  651. sync GetGraphicsFeatureStatus(int32_t aFeature) returns (int32_t aStatus, nsCString aFailureCode,
  652. bool aSuccess);
  653. // Graphics errors
  654. async GraphicsError(nsCString aError);
  655. // Driver crash guards. aGuardType must be a member of CrashGuardType.
  656. sync BeginDriverCrashGuard(uint32_t aGuardType) returns (bool crashDetected);
  657. sync EndDriverCrashGuard(uint32_t aGuardType);
  658. async AddIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
  659. async RemoveIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
  660. /**
  661. * This message is only used on X11 platforms.
  662. *
  663. * Send a dup of the plugin process's X socket to the parent
  664. * process. In theory, this scheme keeps the plugin's X resources
  665. * around until after both the plugin process shuts down *and* the
  666. * parent process closes the dup fd. This is used to prevent the
  667. * parent process from crashing on X errors if, e.g., the plugin
  668. * crashes *just before* a repaint and the parent process tries to
  669. * use the newly-invalid surface.
  670. */
  671. async BackUpXResources(FileDescriptor aXSocketFd);
  672. sync OpenAnonymousTemporaryFile() returns (FileDescOrError aFD);
  673. /**
  674. * Keygen requires us to call it after a <keygen> element is parsed and
  675. * before one is submitted. This is urgent because an extension might use
  676. * a CPOW to synchronously submit a keygen element.
  677. */
  678. nested(inside_cpow) sync KeygenProcessValue(nsString oldValue,
  679. nsString challenge,
  680. nsString keytype,
  681. nsString keyparams)
  682. returns (nsString newValue);
  683. /**
  684. * Called to provide the options for <keygen> elements.
  685. */
  686. sync KeygenProvideContent()
  687. returns (nsString aAttribute, nsString[] aContent);
  688. /**
  689. * Tell the chrome process there is an creation of PBrowser.
  690. * return a system-wise unique Id.
  691. */
  692. sync AllocateTabId(TabId openerTabId, IPCTabContext context, ContentParentId cpId)
  693. returns (TabId tabId);
  694. async DeallocateTabId(TabId tabId,
  695. ContentParentId cpId,
  696. bool aMarkedDestroying);
  697. /**
  698. * Tell the chrome process there is a destruction of PBrowser(Tab)
  699. */
  700. async NotifyTabDestroying(TabId tabId,
  701. ContentParentId cpId);
  702. /**
  703. * Starts an offline application cache update.
  704. * @param manifestURI
  705. * URI of the manifest to fetch, the application cache group ID
  706. * @param documentURI
  707. * URI of the document that referred the manifest
  708. * @param loadingPrincipal
  709. * Principal of the document that referred the manifest
  710. * @param stickDocument
  711. * True if the update was initiated by a document load that referred
  712. * a manifest.
  713. * False if the update was initiated by applicationCache.update() call.
  714. *
  715. * Tells the update to carry the documentURI to a potential separate
  716. * update of implicit (master) items.
  717. *
  718. * Why this argument? If the document was not found in an offline cache
  719. * before load and refers a manifest and this manifest itself has not
  720. * been changed since the last fetch, we will not do the application
  721. * cache group update. But we must cache the document (identified by the
  722. * documentURI). This argument will ensure that a previously uncached
  723. * document will get cached and that we don't re-cache a document that
  724. * has already been cached (stickDocument=false).
  725. * @param tabId
  726. * To identify which tab owns the app.
  727. */
  728. async POfflineCacheUpdate(URIParams manifestURI, URIParams documentURI,
  729. PrincipalInfo loadingPrincipal, bool stickDocument);
  730. /**
  731. * Sets "offline-app" permission for the principal. Called when we hit
  732. * a web app with the manifest attribute in <html> and
  733. * offline-apps.allow_by_default is set to true.
  734. */
  735. async SetOfflinePermission(Principal principal);
  736. /**
  737. * Notifies the parent to continue shutting down after the child performs
  738. * its shutdown tasks.
  739. */
  740. async FinishShutdown();
  741. async UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect);
  742. /**
  743. * Initiates an asynchronous request for permission for the
  744. * provided principal.
  745. *
  746. * @param aRequests
  747. * The array of permissions to request.
  748. * @param aPrincipal
  749. * The principal of the request.
  750. * @param tabId
  751. * To identify which tab issues this request.
  752. *
  753. * NOTE: The principal is untrusted in the parent process. Only
  754. * principals that can live in the content process should
  755. * provided.
  756. */
  757. async PContentPermissionRequest(PermissionRequest[] aRequests, Principal aPrincipal,
  758. TabId tabId);
  759. /**
  760. * Request graphics initialization information from the parent.
  761. */
  762. sync GetGraphicsDeviceInitData()
  763. returns (ContentDeviceData aData);
  764. sync CreateWindow(nullable PBrowser aThisTab,
  765. PBrowser aNewTab,
  766. PRenderFrame aRenderFrame,
  767. uint32_t aChromeFlags,
  768. bool aCalledFromJS,
  769. bool aPositionSpecified,
  770. bool aSizeSpecified,
  771. nsCString aFeatures,
  772. nsCString aBaseURI,
  773. DocShellOriginAttributes aOpenerOriginAttributes,
  774. float aFullZoom)
  775. returns (nsresult rv,
  776. bool windowOpened,
  777. FrameScriptInfo[] frameScripts,
  778. nsCString urlToLoad,
  779. TextureFactoryIdentifier textureFactoryIdentifier,
  780. uint64_t layersId);
  781. sync GetAndroidSystemInfo()
  782. returns (AndroidSystemInfo info);
  783. /**
  784. * Tells the parent to ungrab the pointer on the default display.
  785. *
  786. * This is for GTK platforms where we have to ensure the pointer ungrab happens in the
  787. * chrome process as that's the process that receives the pointer event.
  788. */
  789. sync UngrabPointer(uint32_t time);
  790. sync RemovePermission(Principal principal, nsCString permissionType) returns (nsresult rv);
  791. /**
  792. * Tell the parent that a decoder's' benchmark has been completed.
  793. * The result can then be stored in permanent storage.
  794. */
  795. async NotifyBenchmarkResult(nsString aCodecName, uint32_t aDecodeFPS);
  796. /**
  797. * Notify `push-message` observers without data in the parent.
  798. */
  799. async NotifyPushObservers(nsCString scope, Principal principal,
  800. nsString messageId);
  801. /**
  802. * Notify `push-message` observers with data in the parent.
  803. */
  804. async NotifyPushObserversWithData(nsCString scope, Principal principal,
  805. nsString messageId, uint8_t[] data);
  806. /**
  807. * Notify `push-subscription-change` observers in the parent.
  808. */
  809. async NotifyPushSubscriptionChangeObservers(nsCString scope,
  810. Principal principal);
  811. /**
  812. * Tell the parent process that the child process is low on memory. This
  813. * allows the parent process to save a memory report that can potentially be
  814. * sent with a crash report from the content process.
  815. */
  816. async NotifyLowMemory();
  817. async GetFilesRequest(nsID aID, nsString aDirectory, bool aRecursiveFlag);
  818. async DeleteGetFilesRequest(nsID aID);
  819. async StoreAndBroadcastBlobURLRegistration(nsCString url, PBlob blob,
  820. Principal principal);
  821. async UnstoreAndBroadcastBlobURLUnregistration(nsCString url);
  822. sync GetA11yContentId() returns (uint32_t aContentId);
  823. both:
  824. async AsyncMessage(nsString aMessage, CpowEntry[] aCpows,
  825. Principal aPrincipal, ClonedMessageData aData);
  826. /**
  827. * Notify `push-subscription-modified` observers in the parent and child.
  828. */
  829. async NotifyPushSubscriptionModifiedObservers(nsCString scope,
  830. Principal principal);
  831. };
  832. }
  833. }