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 | // Copyright (c) 2004 by Arthur Langereis (arthur_ext at domain xfinitegames, tld com) |
michael@0 | 2 | |
michael@0 | 3 | |
michael@0 | 4 | // 1 op = 2 assigns, 16 compare/branches, 8 ANDs, (0-8) ADDs, 8 SHLs |
michael@0 | 5 | // O(n) |
michael@0 | 6 | function bitsinbyte(b) { |
michael@0 | 7 | var m = 1, c = 0; |
michael@0 | 8 | /* BEGIN LOOP */ |
michael@0 | 9 | while(m<0x100) { |
michael@0 | 10 | if(b & m) c++; |
michael@0 | 11 | m <<= 1; |
michael@0 | 12 | } |
michael@0 | 13 | /* END LOOP */ |
michael@0 | 14 | return c; |
michael@0 | 15 | } |
michael@0 | 16 | |
michael@0 | 17 | function TimeFunc(func) { |
michael@0 | 18 | var x, y, t; |
michael@0 | 19 | /* BEGIN LOOP */ |
michael@0 | 20 | for(var x=0; x<350; x++) { |
michael@0 | 21 | /* BEGIN LOOP */ |
michael@0 | 22 | for(var y=0; y<256; y++) func(y); |
michael@0 | 23 | /* END LOOP */ |
michael@0 | 24 | } |
michael@0 | 25 | /* END LOOP */ |
michael@0 | 26 | } |
michael@0 | 27 | |
michael@0 | 28 | TimeFunc(bitsinbyte); |