2013-02-08 05:11:46 +04:00
|
|
|
/* 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/. */
|
|
|
|
|
2015-11-22 12:44:24 +03:00
|
|
|
const nsIQuotaManagerService = Ci.nsIQuotaManagerService;
|
2013-02-08 05:11:46 +04:00
|
|
|
|
2019-01-17 21:18:31 +03:00
|
|
|
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
2018-01-10 20:25:52 +03:00
|
|
|
|
2015-09-15 21:19:45 +03:00
|
|
|
var gURI = Services.io.newURI("http://localhost");
|
2013-02-08 05:11:46 +04:00
|
|
|
|
2015-11-22 12:44:24 +03:00
|
|
|
function onUsageCallback(request) {}
|
2013-02-08 05:11:46 +04:00
|
|
|
|
|
|
|
function onLoad() {
|
2015-11-22 12:44:24 +03:00
|
|
|
var quotaManagerService = Cc[
|
|
|
|
"@mozilla.org/dom/quota-manager-service;1"
|
|
|
|
].getService(nsIQuotaManagerService);
|
2019-07-08 19:37:45 +03:00
|
|
|
let principal = Services.scriptSecurityManager.createContentPrincipal(
|
2015-07-04 00:36:28 +03:00
|
|
|
gURI,
|
|
|
|
{}
|
|
|
|
);
|
2015-11-22 12:44:24 +03:00
|
|
|
var quotaRequest = quotaManagerService.getUsageForPrincipal(
|
|
|
|
principal,
|
|
|
|
onUsageCallback
|
|
|
|
);
|
2013-03-26 15:13:17 +04:00
|
|
|
quotaRequest.cancel();
|
2017-04-15 00:39:17 +03:00
|
|
|
Services.obs.notifyObservers(window, "bug839193-loaded");
|
2013-02-08 05:11:46 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
function onUnload() {
|
2017-04-15 00:39:17 +03:00
|
|
|
Services.obs.notifyObservers(window, "bug839193-unloaded");
|
2013-02-08 05:11:46 +04:00
|
|
|
}
|