webapprt/RemoteDebugger.jsm
author Robert Longson <longsonr@gmail.com>
Sat, 24 Jan 2015 09:35:22 +0000
changeset 225511 dfab66d1510b151d84764ad2237e83c2590065fb
parent 219130 b16c58046543597ba9b4b6632cbaacf2a32f2814
child 257080 2fcd73fa8a7e713719ae9ce2c04cc6a458d7735a
permissions -rw-r--r--
Bug 1125201 - Make forceRedraw nothrow. r=bzbarsky

/* 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/. */

"use strict";

this.EXPORTED_SYMBOLS = ["RemoteDebugger"];

let Cc = Components.classes;
let Ci = Components.interfaces;
let Cu = Components.utils;

Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import('resource://gre/modules/devtools/dbg-server.jsm');

this.RemoteDebugger = {
  init: function(port) {
    if (!DebuggerServer.initialized) {
      DebuggerServer.init();
      DebuggerServer.addBrowserActors("webapprt:webapp");
      DebuggerServer.addActors("chrome://webapprt/content/dbg-webapp-actors.js");
    }
    let listener = DebuggerServer.createListener();
    listener.portOrPath = port;
    listener.open();
  }
}