PBrowser.ipdl 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900
  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 PBlob;
  6. include protocol PColorPicker;
  7. include protocol PContent;
  8. include protocol PContentBridge;
  9. include protocol PDocAccessible;
  10. include protocol PFilePicker;
  11. include protocol PIndexedDBPermissionRequest;
  12. include protocol PRenderFrame;
  13. include protocol PPluginWidget;
  14. include protocol PRemotePrintJob;
  15. include DOMTypes;
  16. include JavaScriptTypes;
  17. include URIParams;
  18. include PPrintingTypes;
  19. include PTabContext;
  20. using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";
  21. using class mozilla::gfx::Matrix from "mozilla/gfx/Matrix.h";
  22. using struct gfxSize from "gfxPoint.h";
  23. using CSSRect from "Units.h";
  24. using CSSSize from "Units.h";
  25. using mozilla::LayoutDeviceIntRect from "Units.h";
  26. using mozilla::LayoutDeviceIntPoint from "Units.h";
  27. using mozilla::LayoutDevicePoint from "Units.h";
  28. using mozilla::ScreenIntPoint from "Units.h";
  29. using ScreenIntSize from "Units.h";
  30. using struct mozilla::layers::FrameMetrics from "FrameMetrics.h";
  31. using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h";
  32. using struct mozilla::layers::ZoomConstraints from "FrameMetrics.h";
  33. using mozilla::layers::MaybeZoomConstraints from "FrameMetrics.h";
  34. using mozilla::layers::GeckoContentController::TapType from "mozilla/layers/GeckoContentController.h";
  35. using FrameMetrics::ViewID from "FrameMetrics.h";
  36. using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
  37. using mozilla::WindowsHandle from "ipc/IPCMessageUtils.h";
  38. using nscolor from "nsColor.h";
  39. using class mozilla::WidgetCompositionEvent from "ipc/nsGUIEventIPC.h";
  40. using struct mozilla::widget::IMENotification from "nsIWidget.h";
  41. using struct nsIMEUpdatePreference from "nsIWidget.h";
  42. using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
  43. using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
  44. using mozilla::gfx::IntRect from "mozilla/gfx/Rect.h";
  45. using class mozilla::ContentCache from "ipc/nsGUIEventIPC.h";
  46. using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h";
  47. using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
  48. using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h";
  49. using class mozilla::WidgetDragEvent from "ipc/nsGUIEventIPC.h";
  50. using struct nsRect from "nsRect.h";
  51. using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h";
  52. using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h";
  53. using class mozilla::WidgetPluginEvent from "ipc/nsGUIEventIPC.h";
  54. using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageUtils.h";
  55. using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
  56. using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
  57. using mozilla::CSSToScreenScale from "Units.h";
  58. using mozilla::CommandInt from "mozilla/EventForwards.h";
  59. using mozilla::WritingMode from "mozilla/WritingModes.h";
  60. using mozilla::layers::TouchBehaviorFlags from "mozilla/layers/APZUtils.h";
  61. using nsIWidget::TouchPointerState from "nsIWidget.h";
  62. using struct LookAndFeelInt from "mozilla/widget/WidgetMessageUtils.h";
  63. using class mozilla::dom::MessagePort from "mozilla/dom/MessagePort.h";
  64. using class mozilla::dom::ipc::StructuredCloneData from "mozilla/dom/ipc/StructuredCloneData.h";
  65. using mozilla::EventMessage from "mozilla/EventForwards.h";
  66. using nsEventStatus from "mozilla/EventForwards.h";
  67. using mozilla::Modifiers from "mozilla/EventForwards.h";
  68. using nsSizeMode from "nsIWidgetListener.h";
  69. using mozilla::widget::CandidateWindowPosition from "ipc/nsGUIEventIPC.h";
  70. using class mozilla::NativeEventData from "ipc/nsGUIEventIPC.h";
  71. using mozilla::FontRange from "ipc/nsGUIEventIPC.h";
  72. using mozilla::a11y::IAccessibleHolder from "mozilla/a11y/IPCTypes.h";
  73. namespace mozilla {
  74. namespace dom {
  75. struct NativeKeyBinding
  76. {
  77. CommandInt[] singleLineCommands;
  78. CommandInt[] multiLineCommands;
  79. CommandInt[] richTextCommands;
  80. };
  81. union MaybeNativeKeyBinding
  82. {
  83. NativeKeyBinding;
  84. void_t;
  85. };
  86. struct ShowInfo
  87. {
  88. nsString name;
  89. bool fullscreenAllowed;
  90. bool isPrivate;
  91. bool fakeShowInfo;
  92. bool isTransparent;
  93. float dpi;
  94. int32_t widgetRounding;
  95. double defaultScale;
  96. };
  97. union OptionalShmem
  98. {
  99. void_t;
  100. Shmem;
  101. };
  102. nested(upto inside_cpow) sync protocol PBrowser
  103. {
  104. manager PContent or PContentBridge;
  105. manages PColorPicker;
  106. manages PDocAccessible;
  107. manages PFilePicker;
  108. manages PIndexedDBPermissionRequest;
  109. manages PRenderFrame;
  110. manages PPluginWidget;
  111. both:
  112. async AsyncMessage(nsString aMessage, CpowEntry[] aCpows,
  113. Principal aPrincipal, ClonedMessageData aData);
  114. /**
  115. * Create a layout frame (encapsulating a remote layer tree) for
  116. * the page that is currently loaded in the <browser>.
  117. */
  118. async PRenderFrame();
  119. parent:
  120. /**
  121. * Tell the parent process a new accessible document has been created.
  122. * aParentDoc is the accessible document it was created in if any, and
  123. * aParentAcc is the id of the accessible in that document the new document
  124. * is a child of. aMsaaID is the MSAA id for this content process, and
  125. * is only valid on Windows. Set to 0 on other platforms. aDocCOMProxy
  126. * is also Windows-specific and should be set to 0 on other platforms.
  127. */
  128. async PDocAccessible(nullable PDocAccessible aParentDoc, uint64_t aParentAcc,
  129. uint32_t aMsaaID, IAccessibleHolder aDocCOMProxy);
  130. /*
  131. * Creates a new remoted nsIWidget connection for windowed plugins
  132. * in e10s mode. This is always initiated from the child in response
  133. * to windowed plugin creation.
  134. */
  135. sync PPluginWidget();
  136. /**
  137. * Return native data of root widget
  138. */
  139. nested(inside_cpow) sync GetWidgetNativeData() returns (WindowsHandle value);
  140. /**
  141. * Sends an NS_NATIVE_CHILD_OF_SHAREABLE_WINDOW to be adopted by the
  142. * widget's shareable window on the chrome side. Only used on Windows.
  143. */
  144. async SetNativeChildOfShareableWindow(uintptr_t childWindow);
  145. /**
  146. * When content moves focus from a native plugin window that's a child
  147. * of the native browser window we need to move native focus to the
  148. * browser. Otherwise the plugin window will never relinquish focus.
  149. */
  150. sync DispatchFocusToTopLevelWindow();
  151. parent:
  152. /**
  153. * When child sends this message, parent should move focus to
  154. * the next or previous focusable element or document.
  155. */
  156. async MoveFocus(bool forward, bool forDocumentNavigation);
  157. /**
  158. * SizeShellTo request propagation to parent.
  159. *
  160. * aFlag Can indicate if one of the dimensions should be ignored.
  161. * If only one dimension has changed it has to be indicated
  162. * by the nsIEmbeddingSiteWindow::DIM_FLAGS_IGNORE_* flags.
  163. * aShellItemWidth,
  164. * aShellItemHeight On parent side we won't be able to decide the dimensions
  165. * of the shell item parameter in the original SizeShellTo
  166. * call so we send over its dimensions that will be used
  167. * for the actual resize.
  168. **/
  169. async SizeShellTo(uint32_t aFlag, int32_t aWidth, int32_t aHeight,
  170. int32_t aShellItemWidth, int32_t aShellItemHeight);
  171. /**
  172. * Called by the child to inform the parent that links are dropped into
  173. * content area.
  174. *
  175. * aLinks A flat array of url, name, and type for each link
  176. */
  177. async DropLinks(nsString[] aLinks);
  178. async Event(RemoteDOMEvent aEvent);
  179. sync SyncMessage(nsString aMessage, ClonedMessageData aData,
  180. CpowEntry[] aCpows, Principal aPrincipal)
  181. returns (StructuredCloneData[] retval);
  182. nested(inside_sync) sync RpcMessage(nsString aMessage, ClonedMessageData aData,
  183. CpowEntry[] aCpows, Principal aPrincipal)
  184. returns (StructuredCloneData[] retval);
  185. /**
  186. * Notifies chrome that there is a focus change involving an editable
  187. * object (input, textarea, document, contentEditable. etc.)
  188. *
  189. * contentCache Cache of content
  190. * notification Whole data of the notification
  191. * preference Native widget preference for IME updates
  192. */
  193. nested(inside_cpow) sync NotifyIMEFocus(ContentCache contentCache,
  194. IMENotification notification)
  195. returns (nsIMEUpdatePreference preference);
  196. /**
  197. * Notifies chrome that there has been a change in text content
  198. * One call can encompass both a delete and an insert operation
  199. * Only called when NotifyIMEFocus returns PR_TRUE for mWantUpdates
  200. *
  201. * contentCache Cache of content
  202. * notification Whole data of the notification
  203. */
  204. nested(inside_cpow) async NotifyIMETextChange(ContentCache contentCache,
  205. IMENotification notification);
  206. /**
  207. * Notifies chrome that there is a IME compostion rect updated
  208. *
  209. * contentCache Cache of content
  210. */
  211. nested(inside_cpow) async NotifyIMECompositionUpdate(ContentCache contentCache,
  212. IMENotification notification);
  213. /**
  214. * Notifies chrome that there has been a change in selection
  215. * Only called when NotifyIMEFocus returns PR_TRUE for mWantUpdates
  216. *
  217. * contentCache Cache of content
  218. * notification Whole data of the notification
  219. */
  220. nested(inside_cpow) async NotifyIMESelection(ContentCache contentCache,
  221. IMENotification notification);
  222. /**
  223. * Notifies chrome of updating its content cache.
  224. * This is useful if content is modified but we don't need to notify IME.
  225. *
  226. * contentCache Cache of content
  227. */
  228. nested(inside_cpow) async UpdateContentCache(ContentCache contentCache);
  229. /**
  230. * Notifies IME of mouse button event on a character in focused editor.
  231. *
  232. * Returns true if the mouse button event is consumd by IME.
  233. */
  234. nested(inside_cpow) sync NotifyIMEMouseButtonEvent(IMENotification notification)
  235. returns (bool consumedByIME);
  236. /**
  237. * Notifies chrome to position change
  238. *
  239. * contentCache Cache of content
  240. */
  241. nested(inside_cpow) async NotifyIMEPositionChange(ContentCache contentCache,
  242. IMENotification notification);
  243. /**
  244. * Requests chrome to commit or cancel composition of IME.
  245. *
  246. * cancel Set true if composition should be cancelled.
  247. *
  248. * isCommitted Returns true if the request causes composition
  249. * being committed synchronously.
  250. * committedString Returns committed string. The may be non-empty
  251. * string even if cancel is true because IME may
  252. * try to restore selected string which was
  253. * replaced with the composition.
  254. */
  255. nested(inside_cpow) sync RequestIMEToCommitComposition(bool cancel)
  256. returns (bool isCommitted, nsString committedString);
  257. /**
  258. * OnEventNeedingAckHandled() is called after a child process dispatches a
  259. * composition event or a selection event which is sent from the parent
  260. * process.
  261. *
  262. * message The message value of the handled event.
  263. */
  264. nested(inside_cpow) async OnEventNeedingAckHandled(EventMessage message);
  265. /**
  266. * Tells chrome to start plugin IME. If this results in a string getting
  267. * committed, the result is in aCommitted (otherwise aCommitted is empty).
  268. *
  269. * aKeyboardEvent The event with which plugin IME is to be started
  270. * panelX and panelY Location in screen coordinates of the IME input panel
  271. * (should be just under the plugin)
  272. * aCommitted The string committed during IME -- otherwise empty
  273. */
  274. nested(inside_cpow) sync StartPluginIME(WidgetKeyboardEvent aKeyboardEvent,
  275. int32_t panelX, int32_t panelY)
  276. returns (nsString aCommitted);
  277. /**
  278. * Tells chrome (and specifically the appropriate widget) whether or not
  279. * a plugin (inside the widget) has the keyboard focus. Should be sent
  280. * when the keyboard focus changes too or from a plugin.
  281. *
  282. * aFocused Whether or not a plugin is focused
  283. */
  284. nested(inside_cpow) async SetPluginFocused(bool aFocused);
  285. /**
  286. * Set IME candidate window by windowless plugin if plugin has focus.
  287. */
  288. async SetCandidateWindowForPlugin(CandidateWindowPosition aPosition);
  289. /**
  290. * Notifies the parent process of native key event data received in a
  291. * plugin process directly.
  292. *
  293. * aKeyEventData The native key event data. The actual type copied into
  294. * NativeEventData depending on the caller. Please check
  295. * PluginInstanceChild.
  296. */
  297. nested(inside_cpow) async OnWindowedPluginKeyEvent(NativeEventData aKeyEventData);
  298. /**
  299. * When plugin event isn't consumed, call this
  300. */
  301. async DefaultProcOfPluginEvent(WidgetPluginEvent aEvent);
  302. /**
  303. * Request that the parent process move focus to the browser's frame. If
  304. * canRaise is true, the window can be raised if it is inactive.
  305. */
  306. async RequestFocus(bool canRaise);
  307. /**
  308. * Indicate, based on the current state, that some commands are enabled and
  309. * some are disabled.
  310. */
  311. async EnableDisableCommands(nsString action,
  312. nsCString[] enabledCommands,
  313. nsCString[] disabledCommands);
  314. nested(inside_cpow) sync GetInputContext() returns (int32_t IMEEnabled,
  315. int32_t IMEOpen);
  316. nested(inside_cpow) async SetInputContext(int32_t IMEEnabled,
  317. int32_t IMEOpen,
  318. nsString type,
  319. nsString inputmode,
  320. nsString actionHint,
  321. int32_t cause,
  322. int32_t focusChange);
  323. sync IsParentWindowMainWidgetVisible() returns (bool visible);
  324. /**
  325. * Gets the DPI of the screen corresponding to this browser.
  326. */
  327. sync GetDPI() returns (float value);
  328. /**
  329. * Gets the default scaling factor of the screen corresponding to this browser.
  330. */
  331. sync GetDefaultScale() returns (double value);
  332. /**
  333. * Gets the rounding of coordinates in the widget.
  334. */
  335. sync GetWidgetRounding() returns (int32_t value);
  336. /**
  337. * Gets maximum of touch points at current device.
  338. */
  339. sync GetMaxTouchPoints() returns (uint32_t value);
  340. /**
  341. * Set the native cursor.
  342. * @param value
  343. * The widget cursor to set.
  344. * @param force
  345. * Invalidate any locally cached cursor settings and force an
  346. * update.
  347. */
  348. async SetCursor(uint32_t value, bool force);
  349. /**
  350. * Set the native cursor using a custom image.
  351. * @param cursorData
  352. * Serialized image data.
  353. * @param width
  354. * Width of the image.
  355. * @param height
  356. * Height of the image.
  357. * @param stride
  358. * Stride used in the image data.
  359. * @param format
  360. * Image format, see gfx::SurfaceFormat for possible values.
  361. * @param hotspotX
  362. * Horizontal hotspot of the image, as specified by the css cursor property.
  363. * @param hotspotY
  364. * Vertical hotspot of the image, as specified by the css cursor property.
  365. * @param force
  366. * Invalidate any locally cached cursor settings and force an
  367. * update.
  368. */
  369. async SetCustomCursor(nsCString cursorData, uint32_t width, uint32_t height,
  370. uint32_t stride, uint8_t format,
  371. uint32_t hotspotX, uint32_t hotspotY, bool force);
  372. /**
  373. * Used to set the current text of the status tooltip.
  374. * Nowadays this is mainly used for link locations on hover.
  375. */
  376. async SetStatus(uint32_t type, nsString status);
  377. /**
  378. * Show/hide a tooltip when the mouse hovers over an element in the content
  379. * document.
  380. */
  381. async ShowTooltip(uint32_t x, uint32_t y, nsString tooltip, nsString direction);
  382. async HideTooltip();
  383. /**
  384. * Create an asynchronous color picker on the parent side,
  385. * but don't open it yet.
  386. */
  387. async PColorPicker(nsString title, nsString initialColor);
  388. async PFilePicker(nsString aTitle, int16_t aMode);
  389. /**
  390. * Initiates an asynchronous request for one of the special indexedDB
  391. * permissions for the provided principal.
  392. *
  393. * @param principal
  394. * The principal of the request.
  395. *
  396. * NOTE: The principal is untrusted in the parent process. Only
  397. * principals that can live in the content process should
  398. * provided.
  399. */
  400. async PIndexedDBPermissionRequest(Principal principal);
  401. /**
  402. * window.open from inside <iframe mozbrowser> is special. When the child
  403. * process calls window.open, it creates a new PBrowser (in its own
  404. * process), then calls BrowserFrameOpenWindow on it.
  405. *
  406. * The parent process gets a chance to accept or reject the window.open
  407. * call, and windowOpened is set to true if we ended up going through with
  408. * the window.open.
  409. *
  410. * @param opener the PBrowser whose content called window.open.
  411. */
  412. sync BrowserFrameOpenWindow(PBrowser opener, PRenderFrame renderFrame,
  413. nsString aURL, nsString aName, nsString aFeatures)
  414. returns (bool windowOpened,
  415. TextureFactoryIdentifier textureFactoryIdentifier,
  416. uint64_t layersId);
  417. /**
  418. * Tells the containing widget whether the given input block results in a
  419. * swipe. Should be called in response to a WidgetWheelEvent that has
  420. * mFlags.mCanTriggerSwipe set on it.
  421. */
  422. async RespondStartSwipeEvent(uint64_t aInputBlockId, bool aStartSwipe);
  423. /**
  424. * Brings up the auth prompt dialog.
  425. * Called when this is the PBrowserParent for a nested remote iframe.
  426. * aCallbackId corresponds to an nsIAuthPromptCallback that lives in the
  427. * root process. It will be passed back to the root process with either the
  428. * OnAuthAvailable or OnAuthCancelled message.
  429. */
  430. async AsyncAuthPrompt(nsCString uri, nsString realm, uint64_t aCallbackId);
  431. /**
  432. * Look up dictionary by selected word for OSX
  433. *
  434. * @param aText The word to look up
  435. * @param aFontRange Text decoration of aText
  436. * @param aIsVertical true if vertical layout
  437. */
  438. async LookUpDictionary(nsString aText, FontRange[] aFontRangeArray,
  439. bool aIsVertical, LayoutDeviceIntPoint aPoint);
  440. async __delete__();
  441. async ReplyKeyEvent(WidgetKeyboardEvent event);
  442. async DispatchAfterKeyboardEvent(WidgetKeyboardEvent event);
  443. sync RequestNativeKeyBindings(WidgetKeyboardEvent event)
  444. returns (MaybeNativeKeyBinding bindings);
  445. async SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout,
  446. int32_t aNativeKeyCode,
  447. uint32_t aModifierFlags,
  448. nsString aCharacters,
  449. nsString aUnmodifiedCharacters,
  450. uint64_t aObserverId);
  451. async SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
  452. uint32_t aNativeMessage,
  453. uint32_t aModifierFlags,
  454. uint64_t aObserverId);
  455. async SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
  456. uint64_t aObserverId);
  457. async SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint aPoint,
  458. uint32_t aNativeMessage,
  459. double aDeltaX,
  460. double aDeltaY,
  461. double aDeltaZ,
  462. uint32_t aModifierFlags,
  463. uint32_t aAdditionalFlags,
  464. uint64_t aObserverId);
  465. async SynthesizeNativeTouchPoint(uint32_t aPointerId,
  466. TouchPointerState aPointerState,
  467. LayoutDeviceIntPoint aPoint,
  468. double aPointerPressure,
  469. uint32_t aPointerOrientation,
  470. uint64_t aObserverId);
  471. async SynthesizeNativeTouchTap(LayoutDeviceIntPoint aPoint,
  472. bool aLongTap,
  473. uint64_t aObserverId);
  474. async ClearNativeTouchSequence(uint64_t aObserverId);
  475. /**
  476. * Returns the number of tabs in the window via the out parameter.
  477. * If the number of tabs can't be determined, returns 0.
  478. *
  479. * @param aValue where to store the tab count
  480. */
  481. sync GetTabCount() returns (uint32_t value);
  482. async AccessKeyNotHandled(WidgetKeyboardEvent event);
  483. child:
  484. async NativeSynthesisResponse(uint64_t aObserverId, nsCString aResponse);
  485. parent:
  486. /**
  487. * Child informs the parent that the graphics objects are ready for
  488. * compositing. This is sent when all pending changes have been
  489. * sent to the compositor and are ready to be shown on the next composite.
  490. * @see PCompositor
  491. * @see RequestNotifyAfterRemotePaint
  492. */
  493. async RemotePaintIsReady();
  494. /**
  495. * Child informs the parent that the layer tree is already available.
  496. */
  497. async ForcePaintNoOp(uint64_t aLayerObserverEpoch);
  498. /**
  499. * Sent by the child to the parent to inform it that an update to the
  500. * dimensions has been requested, likely through win.moveTo or resizeTo
  501. */
  502. async SetDimensions(uint32_t aFlags, int32_t aX, int32_t aY, int32_t aCx, int32_t aCy);
  503. nested(inside_sync) sync DispatchWheelEvent(WidgetWheelEvent event);
  504. nested(inside_sync) sync DispatchMouseEvent(WidgetMouseEvent event);
  505. nested(inside_sync) sync DispatchKeyboardEvent(WidgetKeyboardEvent event);
  506. async InvokeDragSession(IPCDataTransfer[] transfers, uint32_t action,
  507. OptionalShmem visualData,
  508. uint32_t stride, uint8_t format,
  509. LayoutDeviceIntRect dragRect);
  510. async AudioChannelActivityNotification(uint32_t aAudioChannel,
  511. bool aActive);
  512. // After a compositor reset, it is necessary to reconnect each layers ID to
  513. // the compositor of the widget that will render those layers. Note that
  514. // this is sync so we can ensure that messages to the window compositor
  515. // arrive before the TabChild attempts to use its cross-process compositor
  516. // bridge.
  517. sync EnsureLayersConnected();
  518. /**
  519. * Notify parent that one or more entries have been added / removed from
  520. * the child session history.
  521. *
  522. * @param aCount the updated number of entries in child session history
  523. */
  524. async NotifySessionHistoryChange(uint32_t aCount);
  525. /**
  526. * When the session history is across multiple root docshells, this function
  527. * is used to notify parent that it needs to navigate to an entry out of
  528. * local index of the child.
  529. *
  530. * @param aGlobalIndex The global index of history entry to navigate to.
  531. */
  532. async RequestCrossBrowserNavigation(uint32_t aGlobalIndex);
  533. child:
  534. /**
  535. * Notify the remote browser that it has been Show()n on this
  536. * side, with the given |visibleRect|. This message is expected
  537. * to trigger creation of the remote browser's "widget".
  538. *
  539. * |Show()| and |Move()| take IntSizes rather than Rects because
  540. * content processes always render to a virtual <0, 0> top-left
  541. * point.
  542. */
  543. async Show(ScreenIntSize size,
  544. ShowInfo info,
  545. TextureFactoryIdentifier textureFactoryIdentifier,
  546. uint64_t layersId,
  547. nullable PRenderFrame renderFrame,
  548. bool parentIsActive,
  549. nsSizeMode sizeMode);
  550. async LoadURL(nsCString uri, ShowInfo info);
  551. async UpdateDimensions(CSSRect rect, CSSSize size,
  552. ScreenOrientationInternal orientation,
  553. LayoutDeviceIntPoint clientOffset,
  554. LayoutDeviceIntPoint chromeDisp) compressall;
  555. async SizeModeChanged(nsSizeMode sizeMode);
  556. /**
  557. * Sending an activate message moves focus to the child.
  558. */
  559. async Activate();
  560. async Deactivate();
  561. async ParentActivated(bool aActivated);
  562. async SetKeyboardIndicators(UIStateChangeType showAccelerators,
  563. UIStateChangeType showFocusRings);
  564. /**
  565. * StopIMEStateManagement() is called when the process loses focus and
  566. * should stop managing IME state.
  567. */
  568. async StopIMEStateManagement();
  569. /**
  570. * MenuKeyboardListenerInstalled() is called when menu keyboard listener
  571. * is installed in the parent process.
  572. */
  573. async MenuKeyboardListenerInstalled(bool aInstalled);
  574. /**
  575. * @see nsIDOMWindowUtils sendMouseEvent.
  576. */
  577. async MouseEvent(nsString aType,
  578. float aX,
  579. float aY,
  580. int32_t aButton,
  581. int32_t aClickCount,
  582. int32_t aModifiers,
  583. bool aIgnoreRootScrollFrame);
  584. /**
  585. * When two consecutive mouse move events would be added to the message queue,
  586. * they are 'compressed' by dumping the oldest one.
  587. */
  588. async RealMouseMoveEvent(WidgetMouseEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId) compress;
  589. /**
  590. * Mouse move events with |reason == eSynthesized| are sent via a separate
  591. * message because they do not generate DOM 'mousemove' events, and the
  592. * 'compress' attribute on RealMouseMoveEvent() could result in a
  593. * |reason == eReal| event being dropped in favour of an |eSynthesized|
  594. * event, and thus a DOM 'mousemove' event to be lost.
  595. */
  596. async SynthMouseMoveEvent(WidgetMouseEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
  597. async RealMouseButtonEvent(WidgetMouseEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
  598. async RealKeyEvent(WidgetKeyboardEvent event, MaybeNativeKeyBinding keyBinding);
  599. async MouseWheelEvent(WidgetWheelEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
  600. async RealTouchEvent(WidgetTouchEvent aEvent,
  601. ScrollableLayerGuid aGuid,
  602. uint64_t aInputBlockId,
  603. nsEventStatus aApzResponse);
  604. async HandleTap(TapType aType, LayoutDevicePoint point, Modifiers aModifiers,
  605. ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
  606. async RealTouchMoveEvent(WidgetTouchEvent aEvent,
  607. ScrollableLayerGuid aGuid,
  608. uint64_t aInputBlockId,
  609. nsEventStatus aApzResponse);
  610. async RealDragEvent(WidgetDragEvent aEvent, uint32_t aDragAction, uint32_t aDropEffect);
  611. async PluginEvent(WidgetPluginEvent aEvent);
  612. /**
  613. * @see nsIDOMWindowUtils sendKeyEvent.
  614. */
  615. async KeyEvent(nsString aType,
  616. int32_t aKeyCode,
  617. int32_t aCharCode,
  618. int32_t aModifiers,
  619. bool aPreventDefault);
  620. async CompositionEvent(WidgetCompositionEvent event);
  621. async SelectionEvent(WidgetSelectionEvent event);
  622. /**
  623. * Call PasteTransferable via a controller on the content process
  624. * to handle the command content event, "pasteTransferable".
  625. */
  626. async PasteTransferable(IPCDataTransfer aDataTransfer,
  627. bool aIsPrivateData,
  628. Principal aRequestingPrincipal);
  629. /**
  630. * Activate event forwarding from client to parent.
  631. */
  632. async ActivateFrameEvent(nsString aType, bool capture);
  633. async LoadRemoteScript(nsString aURL, bool aRunInGlobalScope);
  634. /**
  635. * Sent by the chrome process when it no longer wants this remote
  636. * <browser>. The child side cleans up in response, then
  637. * finalizing its death by sending back __delete__() to the
  638. * parent.
  639. */
  640. async Destroy();
  641. /**
  642. * Update the child side docShell active (resource use) state.
  643. *
  644. * @param aIsActive
  645. * Whether to activate or deactivate the docshell.
  646. * @param aPreserveLayers
  647. * Whether layer trees should be preserved for inactive docshells.
  648. * @param aLayerObserverEpoch
  649. * The layer observer epoch for this activation. This message should be
  650. * ignored if this epoch has already been observed (via ForcePaint).
  651. */
  652. async SetDocShellIsActive(bool aIsActive, bool aPreserveLayers, uint64_t aLayerObserverEpoch);
  653. /**
  654. * Notify the child that it shouldn't paint the offscreen displayport.
  655. * This is useful to speed up interactive operations over async
  656. * scrolling performance like resize, tabswitch, pageload.
  657. *
  658. * Each enable call must be matched with a disable call. The child
  659. * will remain in the suppress mode as long as there's
  660. * a single unmatched call.
  661. */
  662. async SuppressDisplayport(bool aEnabled);
  663. /**
  664. * Navigate by key (Tab/Shift+Tab/F6/Shift+f6).
  665. */
  666. async NavigateByKey(bool aForward, bool aForDocumentNavigation);
  667. /**
  668. * The parent (chrome thread) requests that the child inform it when
  669. * the graphics objects are ready to display.
  670. * @see PCompositor
  671. * @see RemotePaintIsReady
  672. */
  673. async RequestNotifyAfterRemotePaint();
  674. /**
  675. * Tell the child that the UI resolution changed for the containing
  676. * window.
  677. * To avoid some sync messages from child to parent, we also send the dpi
  678. * and default scale with the notification.
  679. * If we don't know the dpi and default scale, we just pass in a negative
  680. * value (-1) but in the majority of the cases this saves us from two
  681. * sync requests from the child to the parent.
  682. */
  683. async UIResolutionChanged(float dpi, int32_t rounding, double scale);
  684. /**
  685. * Tell the child that the system theme has changed, and that a repaint
  686. * is necessary.
  687. */
  688. async ThemeChanged(LookAndFeelInt[] lookAndFeelIntCache);
  689. /**
  690. * Tell the browser that its frame loader has been swapped
  691. * with another.
  692. */
  693. async SwappedWithOtherRemoteLoader(IPCTabContext context);
  694. /**
  695. * A potential accesskey was just pressed. Look for accesskey targets
  696. * using the list of provided charCodes.
  697. *
  698. * @param event keyboard event
  699. * @param isTrusted true if triggered by a trusted key event
  700. * @param modifierMask indicates which accesskey modifiers are pressed
  701. */
  702. async HandleAccessKey(WidgetKeyboardEvent event,
  703. uint32_t[] charCodes, int32_t modifierMask);
  704. /**
  705. * Propagate a refresh to the child process
  706. */
  707. async AudioChannelChangeNotification(uint32_t aAudioChannel,
  708. float aVolume,
  709. bool aMuted);
  710. /**
  711. * Tells the root child docShell whether or not to use
  712. * global history. This is sent right after the PBrowser
  713. * is bound to a frameloader element.
  714. */
  715. async SetUseGlobalHistory(bool aUse);
  716. /**
  717. * HandledWindowedPluginKeyEvent() is always called after posting a native
  718. * key event with OnWindowedPluginKeyEvent().
  719. *
  720. * @param aKeyEventData The key event which was posted to the parent
  721. * process.
  722. * @param aIsConsumed true if aKeyEventData is consumed in the
  723. * parent process. Otherwise, false.
  724. */
  725. async HandledWindowedPluginKeyEvent(NativeEventData aKeyEventData,
  726. bool aIsConsumed);
  727. /**
  728. * Tell the child to print the current page with the given settings.
  729. *
  730. * @param aOuterWindowID the ID of the outer window to print
  731. * @param aPrintData the serialized settings to print with
  732. */
  733. async Print(uint64_t aOuterWindowID, PrintData aPrintData);
  734. /**
  735. * Update the child with the tab's current top-level native window handle.
  736. * This is used by a11y objects who must expose their native window.
  737. *
  738. * @param aNewHandle The native window handle of the tab's top-level window.
  739. */
  740. async UpdateNativeWindowHandle(uintptr_t aNewHandle);
  741. /**
  742. * Called when the session history of this particular PBrowser has been
  743. * attached to a grouped session history.
  744. *
  745. * @param aOffset The number of entries in the grouped session
  746. * history before this session history object.
  747. */
  748. async NotifyAttachGroupedSessionHistory(uint32_t aOffset);
  749. /**
  750. * Notify that the session history associated to this PBrowser has become
  751. * the active history in the grouped session history.
  752. *
  753. * @param aGlobalLength The up-to-date number of entries in the grouped
  754. * session history.
  755. * @param aTargetLocalIndex The target local index to navigate to.
  756. */
  757. async NotifyPartialSessionHistoryActive(uint32_t aGlobalLength,
  758. uint32_t aTargetLocalIndex);
  759. /**
  760. * Notify that the session history asssociates to this PBrowser has become
  761. * an inactive history in the grouped session history.
  762. */
  763. async NotifyPartialSessionHistoryDeactive();
  764. /**
  765. * Tell the child that it is a fresh process created for a Large-Allocation
  766. * load.
  767. */
  768. async SetFreshProcess();
  769. /*
  770. * FIXME: write protocol!
  771. state LIVE:
  772. send LoadURL goto LIVE;
  773. //etc.
  774. send Destroy goto DYING;
  775. state DYING:
  776. discard send blah;
  777. // etc.
  778. recv __delete__;
  779. */
  780. };
  781. }
  782. }