From 6870f2674169652b9de2102657ce95fcc13d2ac8 Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 22 Jun 2010 09:52:18 +0000 Subject: [PATCH] =?UTF-8?q?FUEL/STEEL=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6684 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- modules/namespace.jsm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/namespace.jsm b/modules/namespace.jsm index 217d46bc..8fda95d5 100644 --- a/modules/namespace.jsm +++ b/modules/namespace.jsm @@ -23,16 +23,20 @@ const Ci = Components.interfaces; const currentRevision = 1; -var hiddenWindow = Cc['@mozilla.org/appshell/appShellService;1'] - .getService(Ci.nsIAppShellService) - .hiddenDOMWindow; +const Application = '@mozilla.org/fuel/application;1' in Cc ? + Cc['@mozilla.org/fuel/application;1'].getService(Ci.fuelIApplication) : + '@mozilla.org/steel/application;1' in Cc ? + Cc['@mozilla.org/steel/application;1'].getService(Ci.steelIApplication) : + null ; +if (!Application) + throw new Error('there is no backend for shared namespaces!'); -if (!('piro.sakura.ne.jp' in hiddenWindow)) - hiddenWindow['piro.sakura.ne.jp'] = {}; +const storage = Application.storage; -var namespaces = hiddenWindow['piro.sakura.ne.jp'].sharedNameSpaces || {}; -if (!('sharedNameSpaces' in hiddenWindow['piro.sakura.ne.jp'])) - hiddenWindow['piro.sakura.ne.jp'].sharedNameSpaces = namespaces; +if (!storage.has('sharednamespaces@piro.sakura.ne.jp')) + storage.set('sharednamespaces@piro.sakura.ne.jp', {}); + +var namespaces = storage.get('sharednamespaces@piro.sakura.ne.jp', null); function getNamespaceFor(aName) {