Commit df57e6b1 authored by Victoria Ajala's avatar Victoria Ajala
Browse files

Bug 1820738 - Used a custom Module base class for WebDriver BiDi. r=jdescottes

parent 6170eb43
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -59,10 +59,6 @@ export class WindowGlobalMessageHandler extends MessageHandler {
    return this.#innerWindowId;
  }

  get processActor() {
    return ChromeUtils.domProcessChild.getActor("WebDriverProcessData");
  }

  get window() {
    return this.context.window;
  }
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ remote.jar:

  # WebDriver BiDi modules
  content/webdriver-bidi/modules/ModuleRegistry.sys.mjs (modules/ModuleRegistry.sys.mjs)
  content/webdriver-bidi/modules/WindowGlobalBiDiModule.sys.mjs (modules/WindowGlobalBiDiModule.sys.mjs)

  # WebDriver BiDi root modules
  content/webdriver-bidi/modules/root/browsingContext.sys.mjs (modules/root/browsingContext.sys.mjs)
+18 −0
Original line number Diff line number Diff line
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";

/**
 * Base class for all WindowGlobal BiDi MessageHandler modules.
 */
export class WindowGlobalBiDiModule extends Module {
  get nodeCache() {
    return this.processActor.getNodeCache();
  }

  get processActor() {
    return ChromeUtils.domProcessChild.getActor("WebDriverProcessData");
  }
}
+2 −2
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
import { WindowGlobalBiDiModule } from "chrome://remote/content/webdriver-bidi/modules/WindowGlobalBiDiModule.sys.mjs";

const lazy = {};

@@ -10,7 +10,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
  LoadListener: "chrome://remote/content/shared/listeners/LoadListener.sys.mjs",
});

class BrowsingContextModule extends Module {
class BrowsingContextModule extends WindowGlobalBiDiModule {
  #loadListener;
  #subscribedEvents;

+2 −2
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs";
import { WindowGlobalBiDiModule } from "chrome://remote/content/webdriver-bidi/modules/WindowGlobalBiDiModule.sys.mjs";

const lazy = {};

@@ -10,7 +10,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
  action: "chrome://remote/content/shared/webdriver/Actions.sys.mjs",
});

class InputModule extends Module {
class InputModule extends WindowGlobalBiDiModule {
  #actionState;

  constructor(messageHandler) {
Loading