Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/utils.js

Issue 5344719420784640: Issue 1479 - nss3 library isn`t being found on OS X (Closed)
Patch Set: Created Oct. 15, 2014, 11:08 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 let ctypes = Components.utils.import("resource://gre/modules/ctypes.jsm", nu ll).ctypes; 624 let ctypes = Components.utils.import("resource://gre/modules/ctypes.jsm", nu ll).ctypes;
625 625
626 let nsslib; 626 let nsslib;
627 try 627 try
628 { 628 {
629 nsslib = ctypes.open(ctypes.libraryName("nss3")); 629 nsslib = ctypes.open(ctypes.libraryName("nss3"));
630 } 630 }
631 catch (e) 631 catch (e)
632 { 632 {
633 // It seems that on Mac OS X the full path name needs to be specified 633 // It seems that on Mac OS X the full path name needs to be specified
634 let file = Services.dirsvc.get("GreD", Ci.nsILocalFile); 634 let file;
635 // Gecko 35 added GreBinD key, see https://bugzilla.mozilla.org/show_bug.c gi?id=1077099
636 if (Services.dirsvc.has("GreBinD"))
637 file = Services.dirsvc.get("GreBinD", Ci.nsILocalFile);
638 else
639 file = Services.dirsvc.get("GreD", Ci.nsILocalFile);
635 file.append(ctypes.libraryName("nss3")); 640 file.append(ctypes.libraryName("nss3"));
636 nsslib = ctypes.open(file.path); 641 nsslib = ctypes.open(file.path);
637 } 642 }
638 643
639 let result = {}; 644 let result = {};
640 645
641 // seccomon.h 646 // seccomon.h
642 result.siUTF8String = 14; 647 result.siUTF8String = 14;
643 648
644 // secoidt.h 649 // secoidt.h
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 Cu.reportError(e); 783 Cu.reportError(e);
779 // Expected, ctypes isn't supported in Gecko 1.9.2 784 // Expected, ctypes isn't supported in Gecko 1.9.2
780 return null; 785 return null;
781 } 786 }
782 }); 787 });
783 788
784 if ("@mozilla.org/messenger/headerparser;1" in Cc) 789 if ("@mozilla.org/messenger/headerparser;1" in Cc)
785 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen ger/headerparser;1", "nsIMsgHeaderParser"); 790 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen ger/headerparser;1", "nsIMsgHeaderParser");
786 else 791 else
787 Utils.headerParser = null; 792 Utils.headerParser = null;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld