Bug 958250 - Improve lazy loading in TelemetryPing.js r=nfroyd

This commit is contained in:
Fabrice Desré 2014-01-09 14:06:02 -08:00
Родитель 939cbd71ae
Коммит 39a69e390d
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -14,10 +14,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
#ifndef MOZ_WIDGET_GONK
Cu.import("resource://gre/modules/LightweightThemeManager.jsm");
#endif
Cu.import("resource://gre/modules/ctypes.jsm");
Cu.import("resource://gre/modules/ThirdPartyCookieProbe.jsm");
Cu.import("resource://gre/modules/TelemetryFile.jsm");
Cu.import("resource://gre/modules/UITelemetry.jsm");
// When modifying the payload in incompatible ways, please bump this version number
const PAYLOAD_VERSION = 1;
@ -67,6 +64,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
"resource://gre/modules/UpdateChannel.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonManagerPrivate",
"resource://gre/modules/AddonManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryFile",
"resource://gre/modules/TelemetryFile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry",
"resource://gre/modules/UITelemetry.jsm");
@ -93,6 +92,7 @@ let processInfo = {
},
getCounters_Windows: function() {
if (!this._initialized){
Cu.import("resource://gre/modules/ctypes.jsm");
this._IO_COUNTERS = new ctypes.StructType("IO_COUNTERS", [
{'readOps': ctypes.unsigned_long_long},
{'writeOps': ctypes.unsigned_long_long},