gecko-dev/mobile/android/modules/geckoview/GeckoViewScroll.jsm
Jim Chen d6e76c014e Bug 1394580 - 3. Lazy-load AndroidLog.jsm; r=droeh
Lazily load AndroidLog.jsm since we only need it for debug logging, and
logging is normally turned off in GeckoView code.

MozReview-Commit-ID: 5HNzYTwujMS

--HG--
extra : rebase_source : f6902e25a445d29001f93e024e7cc82fddbb58f2
2017-09-05 21:26:31 -04:00

39 lines
1016 B
JavaScript

/* 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 = ["GeckoViewScroll"];
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://gre/modules/GeckoViewModule.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyGetter(this, "dump", () =>
Cu.import("resource://gre/modules/AndroidLog.jsm",
{}).AndroidLog.d.bind(null, "ViewScroll"));
function debug(aMsg) {
// dump(aMsg);
}
class GeckoViewScroll extends GeckoViewModule {
init() {
debug("init");
this.frameScriptLoaded = false;
}
register() {
debug("register");
if (!this.frameScriptLoaded) {
this.messageManager.loadFrameScript(
"chrome://geckoview/content/GeckoViewScrollContent.js", true);
this.frameScriptLoaded = true;
}
}
}