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

Delta Between Two Patch Sets: lib/filterStorage.js

Issue 9043026: Adapted private browsing handling to per-window private browsing in Firefox 20 (Closed)
Left Patch Set: Created Dec. 18, 2012, 2:57 p.m.
Right Patch Set: Created Dec. 19, 2012, 2:35 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/contentPolicy.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 * Checks whether private browsing is enabled for a particular window. 726 * Checks whether private browsing is enabled for a particular window.
727 */ 727 */
728 enabledForWindow: function(/**Window*/ wnd) /**Boolean*/ 728 enabledForWindow: function(/**Window*/ wnd) /**Boolean*/
729 { 729 {
730 try 730 try
731 { 731 {
732 return wnd.QueryInterface(Ci.nsIInterfaceRequestor) 732 return wnd.QueryInterface(Ci.nsIInterfaceRequestor)
733 .getInterface(Ci.nsILoadContext) 733 .getInterface(Ci.nsILoadContext)
734 .usePrivateBrowsing; 734 .usePrivateBrowsing;
735 } 735 }
736 catch(e) 736 catch (e)
737 { 737 {
738 // Gecko 19 and below will throw NO_INTERFACE, this is expected 738 // Gecko 19 and below will throw NS_NOINTERFACE, this is expected
Thomas Greiner 2012/12/19 14:21:39 in that case we can check if we actually got a NO_
739 if (e.result != Cr.NS_NOINTERFACE)
740 Cu.reportError(e);
739 return false; 741 return false;
740 } 742 }
741 }, 743 },
742 744
743 init: function() 745 init: function()
744 { 746 {
745 if ("@mozilla.org/privatebrowsing;1" in Cc) 747 if ("@mozilla.org/privatebrowsing;1" in Cc)
746 { 748 {
747 try 749 try
748 { 750 {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 else if (this.wantObj === false && val) 872 else if (this.wantObj === false && val)
871 this.curObj.push(val.replace(/\\\[/g, "[")); 873 this.curObj.push(val.replace(/\\\[/g, "["));
872 } 874 }
873 finally 875 finally
874 { 876 {
875 Filter.knownFilters = origKnownFilters; 877 Filter.knownFilters = origKnownFilters;
876 Subscription.knownSubscriptions = origKnownSubscriptions; 878 Subscription.knownSubscriptions = origKnownSubscriptions;
877 } 879 }
878 } 880 }
879 }; 881 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld