Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* |
michael@0 | 3 | * Any copyright is dedicated to the Public Domain. |
michael@0 | 4 | * http://creativecommons.org/licenses/publicdomain/ |
michael@0 | 5 | * Contributor: Robert Sayre |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | //----------------------------------------------------------------------------- |
michael@0 | 9 | var BUGNUMBER = 449627; |
michael@0 | 10 | var summary = 'Crash with JIT in js_FillPropertyCache'; |
michael@0 | 11 | var actual = 'No Crash'; |
michael@0 | 12 | var expect = 'No Crash'; |
michael@0 | 13 | |
michael@0 | 14 | printBugNumber(BUGNUMBER); |
michael@0 | 15 | printStatus (summary); |
michael@0 | 16 | |
michael@0 | 17 | jit(true); |
michael@0 | 18 | |
michael@0 | 19 | /************************ BROWSER DETECT (http://www.quirksmode.org/js/detect.html) ************************/ |
michael@0 | 20 | |
michael@0 | 21 | if (typeof navigator == 'undefined') |
michael@0 | 22 | { |
michael@0 | 23 | navigator = { |
michael@0 | 24 | userAgent: "Firefox", |
michael@0 | 25 | vendor: "Mozilla", |
michael@0 | 26 | platform: "Mac" |
michael@0 | 27 | }; |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | global = this; |
michael@0 | 31 | |
michael@0 | 32 | var BrowserDetect = { |
michael@0 | 33 | init: function _init() |
michael@0 | 34 | { |
michael@0 | 35 | this.browser=this.searchString(this.dataBrowser) || "An unknown browser"; |
michael@0 | 36 | |
michael@0 | 37 | this.OS= this.searchString(this.dataOS)||"an unknown OS"; |
michael@0 | 38 | }, |
michael@0 | 39 | searchString: function _searchString(a) |
michael@0 | 40 | { |
michael@0 | 41 | for(var i=0; i < a.length; i++) |
michael@0 | 42 | { |
michael@0 | 43 | var b=a[i].string; |
michael@0 | 44 | var c=a[i].prop; |
michael@0 | 45 | this.versionSearchString=a[i].versionSearch||a[i].identity; |
michael@0 | 46 | if(b) |
michael@0 | 47 | { |
michael@0 | 48 | if(b.indexOf(a[i].subString)!=-1) |
michael@0 | 49 | return a[i].identity; |
michael@0 | 50 | } |
michael@0 | 51 | else if(c) |
michael@0 | 52 | return a[i].identity; |
michael@0 | 53 | } |
michael@0 | 54 | }, |
michael@0 | 55 | |
michael@0 | 56 | searchVersion:function _searchVersion(a) |
michael@0 | 57 | { |
michael@0 | 58 | var b=a.indexOf(this.versionSearchString); |
michael@0 | 59 | if(b==-1) |
michael@0 | 60 | return; |
michael@0 | 61 | return parseFloat(a.substring(b+this.versionSearchString.length+1)); |
michael@0 | 62 | }, |
michael@0 | 63 | |
michael@0 | 64 | dataBrowser:[ |
michael@0 | 65 | { |
michael@0 | 66 | string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb" |
michael@0 | 67 | }, |
michael@0 | 68 | { |
michael@0 | 69 | string:navigator.vendor,subString:"Apple",identity:"Safari" |
michael@0 | 70 | }, |
michael@0 | 71 | { |
michael@0 | 72 | prop:global.opera,identity:"Opera" |
michael@0 | 73 | }, |
michael@0 | 74 | { |
michael@0 | 75 | string:navigator.vendor,subString:"iCab",identity:"iCab" |
michael@0 | 76 | }, |
michael@0 | 77 | { |
michael@0 | 78 | string:navigator.vendor,subString:"KDE",identity:"Konqueror" |
michael@0 | 79 | }, |
michael@0 | 80 | { |
michael@0 | 81 | string:navigator.userAgent,subString:"Firefox",identity:"Firefox" |
michael@0 | 82 | }, |
michael@0 | 83 | { |
michael@0 | 84 | string:navigator.vendor,subString:"Camino",identity:"Camino" |
michael@0 | 85 | }, |
michael@0 | 86 | { |
michael@0 | 87 | string:navigator.userAgent,subString:"Netscape",identity:"Netscape" |
michael@0 | 88 | }, |
michael@0 | 89 | { |
michael@0 | 90 | string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE" |
michael@0 | 91 | }, |
michael@0 | 92 | { |
michael@0 | 93 | string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv" |
michael@0 | 94 | }, |
michael@0 | 95 | { |
michael@0 | 96 | string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla" |
michael@0 | 97 | } |
michael@0 | 98 | ], |
michael@0 | 99 | dataOS:[ |
michael@0 | 100 | { |
michael@0 | 101 | string:navigator.platform,subString:"Win",identity:"Windows" |
michael@0 | 102 | }, |
michael@0 | 103 | { |
michael@0 | 104 | string:navigator.platform,subString:"Mac",identity:"Mac" |
michael@0 | 105 | }, |
michael@0 | 106 | { |
michael@0 | 107 | string:navigator.platform,subString:"Linux",identity:"Linux" |
michael@0 | 108 | } |
michael@0 | 109 | ] |
michael@0 | 110 | }; |
michael@0 | 111 | |
michael@0 | 112 | BrowserDetect.init(); |
michael@0 | 113 | |
michael@0 | 114 | jit(false); |
michael@0 | 115 | |
michael@0 | 116 | reportCompare(expect, actual, summary); |