[Pkg-mozext-commits] [requestpolicy] 07/280: remove Services.jsm

David Prévot taffit at moszumanska.debian.org
Sat May 2 20:29:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit 0522f3e800e6a87aba64cf560358ba9ba597192c
Author: Martin Kimmerle <dev at 256k.de>
Date:   Tue Nov 25 05:02:06 2014 +0100

    remove Services.jsm
---
 src/content/lib/FileUtil.jsm | 13 ++++---------
 src/content/lib/Services.jsm | 31 -------------------------------
 2 files changed, 4 insertions(+), 40 deletions(-)

diff --git a/src/content/lib/FileUtil.jsm b/src/content/lib/FileUtil.jsm
index 8853ce7..d05ff62 100644
--- a/src/content/lib/FileUtil.jsm
+++ b/src/content/lib/FileUtil.jsm
@@ -26,11 +26,7 @@ var EXPORTED_SYMBOLS = ["FileUtil"]
 const CI = Components.interfaces;
 const CC = Components.classes;
 
-if (!rp) {
-  var rp = {mod : {}};
-}
-
-Components.utils.import("chrome://requestpolicy/content/lib/Services.jsm", rp.mod);
+Components.utils.import("resource://gre/modules/Services.jsm");
 
 const REQUESTPOLICY_DIR = "requestpolicy";
 
@@ -140,12 +136,11 @@ var FileUtil = {
    * it doesn't already exist. Each subdir, if specified, is created if it does
    * not exist.
    *
-   * @return {nsILocalFile}
+   * @return {nsIFile}
    */
   getRPUserDir : function(subdir1, subdir2, subdir3) {
-    var profileDir = rp.mod.Services.directoryService
-          .get("ProfD", CI.nsIFile);
-    var file = profileDir.clone().QueryInterface(CI.nsILocalFile);
+    var profileDir = Services.dirsvc.get("ProfD", CI.nsIFile);
+    var file = profileDir.clone();
     file.appendRelativePath(REQUESTPOLICY_DIR);
     if(!file.exists()) {
       file.create(CI.nsIFile.DIRECTORY_TYPE, 0700);
diff --git a/src/content/lib/Services.jsm b/src/content/lib/Services.jsm
deleted file mode 100644
index e60e309..0000000
--- a/src/content/lib/Services.jsm
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * ***** BEGIN LICENSE BLOCK *****
- *
- * RequestPolicy - A Firefox extension for control over cross-site requests.
- * Copyright (c) 2008-2012 Justin Samuel
- * Copyright (c) 2014 Martin Kimmerle
- *
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later
- * version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * ***** END LICENSE BLOCK *****
- */
-
-var EXPORTED_SYMBOLS = ["Services"];
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-var Services = {};
-
-XPCOMUtils.defineLazyServiceGetter(Services, "directoryService",
-    "@mozilla.org/file/directory_service;1", "nsIProperties");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list