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 = Components.interfaces.nsIQuotaManagerService;
|
2013-02-08 05:11:46 +04:00
|
|
|
|
2015-09-15 21:19:45 +03:00
|
|
|
var gURI = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI("http://localhost", null, null);
|
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 =
|
|
|
|
Components.classes["@mozilla.org/dom/quota-manager-service;1"]
|
|
|
|
.getService(nsIQuotaManagerService);
|
2015-07-04 00:36:28 +03:00
|
|
|
let principal = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
|
|
|
|
.getService(Components.interfaces.nsIScriptSecurityManager)
|
|
|
|
.createCodebasePrincipal(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();
|
2013-02-08 05:11:46 +04:00
|
|
|
Components.classes["@mozilla.org/observer-service;1"]
|
|
|
|
.getService(Components.interfaces.nsIObserverService)
|
|
|
|
.notifyObservers(window, "bug839193-loaded", null);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onUnload()
|
|
|
|
{
|
|
|
|
Components.classes["@mozilla.org/observer-service;1"]
|
|
|
|
.getService(Components.interfaces.nsIObserverService)
|
|
|
|
.notifyObservers(window, "bug839193-unloaded", null);
|
|
|
|
}
|