Bumping manifests a=b2g-bump
[gecko.git] / dom / requestsync / RequestSyncApp.jsm
blob69ad349d5e536d7b6beee98da949f0271c126370
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 'use strict';
7 this.EXPORTED_SYMBOLS = ['RequestSyncApp'];
9 function debug(s) {
10   //dump('DEBUG RequestSyncApp: ' + s + '\n');
13 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
15 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
17 this.RequestSyncApp = function(aData) {
18   debug('created');
20   let keys = [ 'origin', 'manifestURL', 'isInBrowserElement' ];
21   for (let i = 0; i < keys.length; ++i) {
22     if (!(keys[i] in aData)) {
23       dump("ERROR - RequestSyncApp must receive a full app object: " + keys[i] + " missing.");
24       throw "ERROR!";
25     }
27     this["_" + keys[i]] = aData[keys[i]];
28   }
31 this.RequestSyncApp.prototype = {
32   classDescription: 'RequestSyncApp XPCOM Component',
33   classID: Components.ID('{5a0b64db-a2be-4f08-a6c5-8bf2e3ae0c57}'),
34   contractID: '@mozilla.org/dom/request-sync-manager;1',
35   QueryInterface: XPCOMUtils.generateQI([]),
37   get origin() {
38     return this._origin;
39   },
41   get manifestURL() {
42     return this._manifestURL;
43   },
45   get isInBrowserElement() {
46     return this._isInBrowserElement;
47   }