storage.js 919 B

123456789101112131415161718192021222324252627282930313233
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. const protocol = require("devtools/shared/protocol");
  6. const specs = require("devtools/shared/specs/storage");
  7. for (let childSpec of Object.values(specs.childSpecs)) {
  8. protocol.FrontClassWithSpec(childSpec, {
  9. form(form, detail) {
  10. if (detail === "actorid") {
  11. this.actorID = form;
  12. return null;
  13. }
  14. this.actorID = form.actor;
  15. this.hosts = form.hosts;
  16. return null;
  17. }
  18. });
  19. }
  20. const StorageFront = protocol.FrontClassWithSpec(specs.storageSpec, {
  21. initialize(client, tabForm) {
  22. protocol.Front.prototype.initialize.call(this, client);
  23. this.actorID = tabForm.storageActor;
  24. this.manage(this);
  25. }
  26. });
  27. exports.StorageFront = StorageFront;