Gentoo Archives: gentoo-commits

From: "Julian Ospald (hasufell)" <hasufell@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-client/torbrowser/files/torbrowser-patches: 0001-Block-Components.interfaces-lookupMethod-from-conten.patch 0011-Make-Download-manager-memory-only.patch 0020-Fix-internal-compile-error-for-sub-ancient-GCCs.patch 0005-Block-all-plugins-except-flash.patch 0009-Limit-device-and-system-specific-CSS-Media-Queries.patch 0010-Rebrand-Firefox-to-TorBrowser.patch 0015-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch 0018-Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch 0007-Disable-SSL-Session-ID-tracking.patch 0003-Make-Intermediate-Cert-Store-memory-only.patch 0008-Provide-an-observer-event-to-close-persistent-connec.patch 0004-Add-a-string-based-cacheKey.patch 0019-Fix-Firefox-13-build-process.patch 0012-Add-DDG-and-StartPage-to-Omnibox.patch 0016-Limit-the-number-of-fonts-per-document.patch 0017-Randomize-HTTP-request-order-and-pipeline-depth.patch 0006-Make-content-pref-service-memory-only-clearable.patch 0002-Make-Permi ssions-Manager-me mory-only.patch 0014-Prevent-WebSocket-DNS-leak.patch 0013-Make-nsICacheService.EvictEntries-synchronous.patch 0013-Make-Download-manager-memory-only.patch 0015-Make-nsICacheService.EvictEntries-synchronous.patch 0008-Disable-SSL-Session-ID-tracking.patch 0011-Limit-the-number-of-fonts-per-document.patch 0009-Provide-an-observer-event-to-close-persistent-connec.patch 0012-Rebrand-Firefox-to-TorBrowser.patch 0010-Provide-client-values-only-to-CSS-Media-Queries.patch 0016-Prevent-WebSocket-DNS-leak.patch 0018-Add-HTTP-auth-headers-before-the-modify-request-obse.patch 0014-Add-DDG-and-StartPage-to-Omnibox.patch 0007-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
Date: Sat, 30 Jun 2012 20:43:21
Message-Id: 20120630204310.BCFB02004B@flycatcher.gentoo.org
1 hasufell 12/06/30 20:43:10
2
3 Modified:
4 0001-Block-Components.interfaces-lookupMethod-from-conten.patch
5 0005-Block-all-plugins-except-flash.patch
6 0003-Make-Intermediate-Cert-Store-memory-only.patch
7 0004-Add-a-string-based-cacheKey.patch
8 0017-Randomize-HTTP-request-order-and-pipeline-depth.patch
9 0006-Make-content-pref-service-memory-only-clearable.patch
10 0002-Make-Permissions-Manager-memory-only.patch
11 Added: 0011-Make-Download-manager-memory-only.patch
12 0020-Fix-internal-compile-error-for-sub-ancient-GCCs.patch
13 0009-Limit-device-and-system-specific-CSS-Media-Queries.patch
14 0010-Rebrand-Firefox-to-TorBrowser.patch
15 0015-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
16 0018-Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch
17 0007-Disable-SSL-Session-ID-tracking.patch
18 0008-Provide-an-observer-event-to-close-persistent-connec.patch
19 0019-Fix-Firefox-13-build-process.patch
20 0012-Add-DDG-and-StartPage-to-Omnibox.patch
21 0016-Limit-the-number-of-fonts-per-document.patch
22 0014-Prevent-WebSocket-DNS-leak.patch
23 0013-Make-nsICacheService.EvictEntries-synchronous.patch
24 Removed: 0013-Make-Download-manager-memory-only.patch
25 0015-Make-nsICacheService.EvictEntries-synchronous.patch
26 0008-Disable-SSL-Session-ID-tracking.patch
27 0011-Limit-the-number-of-fonts-per-document.patch
28 0009-Provide-an-observer-event-to-close-persistent-connec.patch
29 0012-Rebrand-Firefox-to-TorBrowser.patch
30 0010-Provide-client-values-only-to-CSS-Media-Queries.patch
31 0016-Prevent-WebSocket-DNS-leak.patch
32 0018-Add-HTTP-auth-headers-before-the-modify-request-obse.patch
33 0014-Add-DDG-and-StartPage-to-Omnibox.patch
34 0007-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
35 Log:
36 version bump, also fixes bug #423343
37
38 (Portage version: 2.2.0_alpha114/cvs/Linux x86_64)
39
40 Revision Changes Path
41 1.2 www-client/torbrowser/files/torbrowser-patches/0001-Block-Components.interfaces-lookupMethod-from-conten.patch
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0001-Block-Components.interfaces-lookupMethod-from-conten.patch?rev=1.2&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0001-Block-Components.interfaces-lookupMethod-from-conten.patch?rev=1.2&content-type=text/plain
45 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0001-Block-Components.interfaces-lookupMethod-from-conten.patch?r1=1.1&r2=1.2
46
47 Index: 0001-Block-Components.interfaces-lookupMethod-from-conten.patch
48 ===================================================================
49 RCS file: /var/cvsroot/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0001-Block-Components.interfaces-lookupMethod-from-conten.patch,v
50 retrieving revision 1.1
51 retrieving revision 1.2
52 diff -u -r1.1 -r1.2
53 --- 0001-Block-Components.interfaces-lookupMethod-from-conten.patch 6 Jun 2012 22:21:08 -0000 1.1
54 +++ 0001-Block-Components.interfaces-lookupMethod-from-conten.patch 30 Jun 2012 20:43:10 -0000 1.2
55 @@ -1,7 +1,7 @@
56 -From 18fea351a9f218893514ccbca82c492ce81d038d Mon Sep 17 00:00:00 2001
57 +From 801d2dcc512ca5e64b72d56faaab7d8ef0fadf39 Mon Sep 17 00:00:00 2001
58 From: Mike Perry <mikeperry-git@××××××××××.org>
59 Date: Wed, 1 Feb 2012 15:40:40 -0800
60 -Subject: [PATCH 01/18] Block Components.interfaces,lookupMethod from content
61 +Subject: [PATCH 01/20] Block Components.interfaces,lookupMethod from content
62
63 This patch removes the ability of content script to access
64 Components.interfaces.* as well as call or access Components.lookupMethod.
65 @@ -20,10 +20,10 @@
66 1 files changed, 6 insertions(+), 2 deletions(-)
67
68 diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp
69 -index 3bcbf91..d5c020a 100644
70 +index a2a1102..49e4c7e 100644
71 --- a/js/xpconnect/src/XPCComponents.cpp
72 +++ b/js/xpconnect/src/XPCComponents.cpp
73 -@@ -4456,7 +4456,9 @@ nsXPCComponents::CanCreateWrapper(const nsIID * iid, char **_retval)
74 +@@ -4287,7 +4287,9 @@ nsXPCComponents::CanCreateWrapper(const nsIID * iid, char **_retval)
75 NS_IMETHODIMP
76 nsXPCComponents::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
77 {
78 @@ -34,7 +34,7 @@
79 *_retval = xpc_CheckAccessList(methodName, allowed);
80 return NS_OK;
81 }
82 -@@ -4465,7 +4467,9 @@ nsXPCComponents::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, c
83 +@@ -4296,7 +4298,9 @@ nsXPCComponents::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, c
84 NS_IMETHODIMP
85 nsXPCComponents::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
86 {
87
88
89
90 1.2 www-client/torbrowser/files/torbrowser-patches/0005-Block-all-plugins-except-flash.patch
91
92 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0005-Block-all-plugins-except-flash.patch?rev=1.2&view=markup
93 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0005-Block-all-plugins-except-flash.patch?rev=1.2&content-type=text/plain
94 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0005-Block-all-plugins-except-flash.patch?r1=1.1&r2=1.2
95
96 Index: 0005-Block-all-plugins-except-flash.patch
97 ===================================================================
98 RCS file: /var/cvsroot/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0005-Block-all-plugins-except-flash.patch,v
99 retrieving revision 1.1
100 retrieving revision 1.2
101 diff -u -r1.1 -r1.2
102 --- 0005-Block-all-plugins-except-flash.patch 6 Jun 2012 22:21:08 -0000 1.1
103 +++ 0005-Block-all-plugins-except-flash.patch 30 Jun 2012 20:43:10 -0000 1.2
104 @@ -1,7 +1,7 @@
105 -From 3457f78e346df5962449cbd5aa86624e19fd5f64 Mon Sep 17 00:00:00 2001
106 +From 47235106c9e1257c66bab774aab330be4dabcfb0 Mon Sep 17 00:00:00 2001
107 From: Mike Perry <mikeperry-git@××××××××××.org>
108 Date: Wed, 1 Feb 2012 15:50:15 -0800
109 -Subject: [PATCH 05/18] Block all plugins except flash.
110 +Subject: [PATCH 05/20] Block all plugins except flash.
111
112 We cannot use the @mozilla.org/extensions/blocklist;1 service, because we
113 actually want to stop plugins from ever entering the browser's process space
114 @@ -17,10 +17,10 @@
115 2 files changed, 35 insertions(+), 0 deletions(-)
116
117 diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp
118 -index 992bcd4..f56f231 100644
119 +index 0c3efa0..e607e68 100644
120 --- a/dom/plugins/base/nsPluginHost.cpp
121 +++ b/dom/plugins/base/nsPluginHost.cpp
122 -@@ -1968,6 +1968,35 @@ bool nsPluginHost::IsDuplicatePlugin(nsPluginTag * aPluginTag)
123 +@@ -2002,6 +2002,35 @@ bool nsPluginHost::IsDuplicatePlugin(nsPluginTag * aPluginTag)
124 return false;
125 }
126
127 @@ -56,7 +56,7 @@
128 typedef NS_NPAPIPLUGIN_CALLBACK(char *, NP_GETMIMEDESCRIPTION)(void);
129
130 nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
131 -@@ -2101,6 +2130,10 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
132 +@@ -2135,6 +2164,10 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
133 continue;
134 }
135
136 @@ -68,10 +68,10 @@
137 if (!pluginTag) {
138 nsPluginFile pluginFile(localfile);
139 diff --git a/dom/plugins/base/nsPluginHost.h b/dom/plugins/base/nsPluginHost.h
140 -index 39a8891..c262abf 100644
141 +index 1b46957..4f1e890 100644
142 --- a/dom/plugins/base/nsPluginHost.h
143 +++ b/dom/plugins/base/nsPluginHost.h
144 -@@ -278,6 +278,8 @@ private:
145 +@@ -285,6 +285,8 @@ private:
146 // Loads all cached plugins info into mCachedPlugins
147 nsresult ReadPluginInfo();
148
149
150
151
152 1.2 www-client/torbrowser/files/torbrowser-patches/0003-Make-Intermediate-Cert-Store-memory-only.patch
153
154 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0003-Make-Intermediate-Cert-Store-memory-only.patch?rev=1.2&view=markup
155 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0003-Make-Intermediate-Cert-Store-memory-only.patch?rev=1.2&content-type=text/plain
156 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0003-Make-Intermediate-Cert-Store-memory-only.patch?r1=1.1&r2=1.2
157
158 Index: 0003-Make-Intermediate-Cert-Store-memory-only.patch
159 ===================================================================
160 RCS file: /var/cvsroot/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0003-Make-Intermediate-Cert-Store-memory-only.patch,v
161 retrieving revision 1.1
162 retrieving revision 1.2
163 diff -u -r1.1 -r1.2
164 --- 0003-Make-Intermediate-Cert-Store-memory-only.patch 6 Jun 2012 22:21:08 -0000 1.1
165 +++ 0003-Make-Intermediate-Cert-Store-memory-only.patch 30 Jun 2012 20:43:10 -0000 1.2
166 @@ -1,7 +1,7 @@
167 -From e6d127b805461470bff0dad12f5ad89fc3cd3df3 Mon Sep 17 00:00:00 2001
168 +From 6b5b4816ffff9875f8fd3364841fde872a2af7a4 Mon Sep 17 00:00:00 2001
169 From: Mike Perry <mikeperry-git@××××××.org>
170 Date: Fri, 19 Aug 2011 17:58:23 -0700
171 -Subject: [PATCH 03/18] Make Intermediate Cert Store memory-only.
172 +Subject: [PATCH 03/20] Make Intermediate Cert Store memory-only.
173
174 This patch makes the intermediate SSL cert store exist in memory only.
175
176 @@ -12,10 +12,10 @@
177 1 files changed, 14 insertions(+), 1 deletions(-)
178
179 diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp
180 -index a08c4ef..0ec3713 100644
181 +index 89ad70e..783d0d2 100644
182 --- a/security/manager/ssl/src/nsNSSComponent.cpp
183 +++ b/security/manager/ssl/src/nsNSSComponent.cpp
184 -@@ -1730,8 +1730,21 @@ nsNSSComponent::InitializeNSS(bool showWarningBox)
185 +@@ -1755,8 +1755,21 @@ nsNSSComponent::InitializeNSS(bool showWarningBox)
186 // Ubuntu 8.04, which loads any nonexistent "<configdir>/libnssckbi.so" as
187 // "/usr/lib/nss/libnssckbi.so".
188 PRUint32 init_flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE;
189
190
191
192 1.2 www-client/torbrowser/files/torbrowser-patches/0004-Add-a-string-based-cacheKey.patch
193
194 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0004-Add-a-string-based-cacheKey.patch?rev=1.2&view=markup
195 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0004-Add-a-string-based-cacheKey.patch?rev=1.2&content-type=text/plain
196 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0004-Add-a-string-based-cacheKey.patch?r1=1.1&r2=1.2
197
198 Index: 0004-Add-a-string-based-cacheKey.patch
199 ===================================================================
200 RCS file: /var/cvsroot/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0004-Add-a-string-based-cacheKey.patch,v
201 retrieving revision 1.1
202 retrieving revision 1.2
203 diff -u -r1.1 -r1.2
204 --- 0004-Add-a-string-based-cacheKey.patch 6 Jun 2012 22:21:08 -0000 1.1
205 +++ 0004-Add-a-string-based-cacheKey.patch 30 Jun 2012 20:43:10 -0000 1.2
206 @@ -1,7 +1,7 @@
207 -From 84668dfe7bdcd35d96ffcaf273ade5a5d8d470f8 Mon Sep 17 00:00:00 2001
208 +From b2dfbf250bc83592e73abf932c5301f1688a277b Mon Sep 17 00:00:00 2001
209 From: Mike Perry <mikeperry-git@××××××.org>
210 Date: Fri, 2 Sep 2011 20:47:02 -0700
211 -Subject: [PATCH 04/18] Add a string-based cacheKey.
212 +Subject: [PATCH 04/20] Add a string-based cacheKey.
213
214 Used for isolating cache according to same-origin policy.
215 ---
216 @@ -29,10 +29,10 @@
217 * may fail if the disk cache is not present. The value of this attribute
218 * is usually only settable during the processing of a channel's
219 diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
220 -index dec2a83..97bd84c 100644
221 +index 34291f4..92f2d7d 100644
222 --- a/netwerk/protocol/http/nsHttpChannel.cpp
223 +++ b/netwerk/protocol/http/nsHttpChannel.cpp
224 -@@ -2392,6 +2392,12 @@ nsHttpChannel::AssembleCacheKey(const char *spec, PRUint32 postID,
225 +@@ -2415,6 +2415,12 @@ nsHttpChannel::AssembleCacheKey(const char *spec, PRUint32 postID,
226 cacheKey.Append(buf);
227 }
228
229 @@ -45,7 +45,7 @@
230 if (!cacheKey.IsEmpty()) {
231 cacheKey.AppendLiteral("uri=");
232 }
233 -@@ -4695,6 +4701,22 @@ nsHttpChannel::SetCacheForOfflineUse(bool value)
234 +@@ -4784,6 +4790,22 @@ nsHttpChannel::SetCacheForOfflineUse(bool value)
235 }
236
237 NS_IMETHODIMP
238 @@ -69,10 +69,10 @@
239 {
240 value = mOfflineCacheClientID;
241 diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h
242 -index 88ce469..53538cf 100644
243 +index f8e59fe..a5b7d1e 100644
244 --- a/netwerk/protocol/http/nsHttpChannel.h
245 +++ b/netwerk/protocol/http/nsHttpChannel.h
246 -@@ -303,6 +303,7 @@ private:
247 +@@ -306,6 +306,7 @@ private:
248 nsCOMPtr<nsICacheEntryDescriptor> mOfflineCacheEntry;
249 nsCacheAccessMode mOfflineCacheAccess;
250 nsCString mOfflineCacheClientID;
251
252
253
254 1.2 www-client/torbrowser/files/torbrowser-patches/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch
255
256 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch?rev=1.2&view=markup
257 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch?rev=1.2&content-type=text/plain
258 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch?r1=1.1&r2=1.2
259
260 Index: 0017-Randomize-HTTP-request-order-and-pipeline-depth.patch
261 ===================================================================
262 RCS file: /var/cvsroot/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch,v
263 retrieving revision 1.1
264 retrieving revision 1.2
265 diff -u -r1.1 -r1.2
266 --- 0017-Randomize-HTTP-request-order-and-pipeline-depth.patch 6 Jun 2012 22:21:08 -0000 1.1
267 +++ 0017-Randomize-HTTP-request-order-and-pipeline-depth.patch 30 Jun 2012 20:43:10 -0000 1.2
268 @@ -1,7 +1,7 @@
269 -From 60d369378ea65b1502ba2ab28a851318e7910a64 Mon Sep 17 00:00:00 2001
270 +From 09c27d0aee130959ee1aae211e9400600c26ade6 Mon Sep 17 00:00:00 2001
271 From: Mike Perry <mikeperry-git@××××××××××.org>
272 -Date: Wed, 6 Jun 2012 11:08:56 -0700
273 -Subject: [PATCH 17/18] Randomize HTTP request order and pipeline depth.
274 +Date: Thu, 7 Jun 2012 15:13:45 -0700
275 +Subject: [PATCH 17/20] Randomize HTTP request order and pipeline depth.
276
277 This is an experimental defense against
278 http://lorre.uni.lu/~andriy/papers/acmccs-wpes11-fingerprinting.pdf
279 @@ -17,13 +17,13 @@
280 2 files changed, 136 insertions(+), 5 deletions(-)
281
282 diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
283 -index 23ef893..788368f 100644
284 +index 463584f..e05669c 100644
285 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
286 +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
287 -@@ -94,6 +94,12 @@ nsHttpConnectionMgr::nsHttpConnectionMgr()
288 - {
289 - LOG(("Creating nsHttpConnectionMgr @%x\n", this));
290 +@@ -101,6 +101,12 @@ nsHttpConnectionMgr::nsHttpConnectionMgr()
291 mCT.Init();
292 + mAlternateProtocolHash.Init(16);
293 + mSpdyPreferredHash.Init();
294 +
295 + nsresult rv;
296 + mRandomGenerator = do_GetService("@mozilla.org/security/random-generator;1", &rv);
297 @@ -33,7 +33,7 @@
298 }
299
300 nsHttpConnectionMgr::~nsHttpConnectionMgr()
301 -@@ -342,8 +348,12 @@ nsHttpConnectionMgr::AddTransactionToPipeline(nsHttpPipeline *pipeline)
302 +@@ -380,8 +386,12 @@ nsHttpConnectionMgr::AddTransactionToPipeline(nsHttpPipeline *pipeline)
303 nsConnectionEntry *ent = mCT.Get(ci->HashKey());
304 if (ent) {
305 // search for another request to pipeline...
306 @@ -48,7 +48,7 @@
307 nsHttpTransaction *trans = ent->mPendingQ[i];
308 if (trans->Caps() & NS_HTTP_ALLOW_PIPELINING) {
309 pipeline->AddTransaction(trans);
310 -@@ -354,6 +364,8 @@ nsHttpConnectionMgr::AddTransactionToPipeline(nsHttpPipeline *pipeline)
311 +@@ -392,6 +402,8 @@ nsHttpConnectionMgr::AddTransactionToPipeline(nsHttpPipeline *pipeline)
312 break;
313 }
314 }
315 @@ -57,17 +57,17 @@
316 }
317 }
318 }
319 -@@ -585,12 +597,17 @@ nsHttpConnectionMgr::ProcessPendingQForEntry(nsConnectionEntry *ent)
320 - LOG(("nsHttpConnectionMgr::ProcessPendingQForEntry [ci=%s]\n",
321 - ent->mConnInfo->HashKey().get()));
322 +@@ -922,12 +934,17 @@ nsHttpConnectionMgr::ProcessPendingQForEntry(nsConnectionEntry *ent)
323 +
324 + ProcessSpdyPendingQ(ent);
325
326 -- PRInt32 i, count = ent->mPendingQ.Length();
327 +- PRUint32 i, count = ent->mPendingQ.Length();
328 + PRUint32 h, i = 0, count = ent->mPendingQ.Length();
329 if (count > 0) {
330 LOG((" pending-count=%u\n", count));
331 nsHttpTransaction *trans = nsnull;
332 nsHttpConnection *conn = nsnull;
333 -- for (i=0; i<count; ++i) {
334 +- for (i = 0; i < count; ++i) {
335 +
336 + PRUint32* ind = new PRUint32[count];
337 + ShuffleRequestOrder(ind, count);
338 @@ -77,22 +77,22 @@
339 trans = ent->mPendingQ[i];
340
341 // When this transaction has already established a half-open
342 -@@ -610,6 +627,7 @@ nsHttpConnectionMgr::ProcessPendingQForEntry(nsConnectionEntry *ent)
343 - if (conn)
344 - break;
345 +@@ -951,6 +968,7 @@ nsHttpConnectionMgr::ProcessPendingQForEntry(nsConnectionEntry *ent)
346 + "something mutated pending queue from "
347 + "GetConnection()");
348 }
349 + delete [] ind;
350 if (conn) {
351 LOG((" dispatching pending transaction...\n"));
352
353 -@@ -694,6 +712,19 @@ nsHttpConnectionMgr::AtActiveConnectionLimit(nsConnectionEntry *ent, PRUint8 cap
354 +@@ -1035,6 +1053,19 @@ nsHttpConnectionMgr::AtActiveConnectionLimit(nsConnectionEntry *ent, PRUint8 cap
355 maxPersistConns = mMaxPersistConnsPerHost;
356 }
357
358 + // Fuzz maxConns for website fingerprinting attack
359 + // We create a range of maxConns/5 up to 6*maxConns/5
360 + // because this function is called repeatedly, and we'll
361 -+ // end up converging to the high side of concurrent connections
362 ++ // end up converging on a the high side of concurrent connections
363 + // after a short while.
364 + PRUint8 *bytes = nsnull;
365 + nsresult rv = mRandomGenerator->GenerateRandomBytes(1, &bytes);
366 @@ -105,8 +105,8 @@
367 // use >= just to be safe
368 return (totalCount >= maxConns) || ( (caps & NS_HTTP_ALLOW_KEEPALIVE) &&
369 (persistCount >= maxPersistConns) );
370 -@@ -865,7 +896,7 @@ nsHttpConnectionMgr::DispatchTransaction(nsConnectionEntry *ent,
371 - nsHttpPipeline *pipeline = nsnull;
372 +@@ -1274,7 +1305,7 @@ nsHttpConnectionMgr::DispatchTransaction(nsConnectionEntry *ent,
373 +
374 if (conn->SupportsPipelining() && (caps & NS_HTTP_ALLOW_PIPELINING)) {
375 LOG((" looking to build pipeline...\n"));
376 - if (BuildPipeline(ent, trans, &pipeline))
377 @@ -114,7 +114,7 @@
378 trans = pipeline;
379 }
380
381 -@@ -938,6 +969,101 @@ nsHttpConnectionMgr::BuildPipeline(nsConnectionEntry *ent,
382 +@@ -1349,6 +1380,101 @@ nsHttpConnectionMgr::BuildPipeline(nsConnectionEntry *ent,
383 return true;
384 }
385
386 @@ -217,19 +217,19 @@
387 nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans)
388 {
389 diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.h b/netwerk/protocol/http/nsHttpConnectionMgr.h
390 -index cdf21a9..81b282a 100644
391 +index 6b4398b..c33870f 100644
392 --- a/netwerk/protocol/http/nsHttpConnectionMgr.h
393 +++ b/netwerk/protocol/http/nsHttpConnectionMgr.h
394 -@@ -51,6 +51,7 @@
395 -
396 +@@ -53,6 +53,7 @@
397 #include "nsIObserver.h"
398 #include "nsITimer.h"
399 + #include "nsIX509Cert3.h"
400 +#include "nsIRandomGenerator.h"
401
402 class nsHttpPipeline;
403
404 -@@ -276,6 +277,8 @@ private:
405 - nsresult DispatchTransaction(nsConnectionEntry *, nsAHttpTransaction *,
406 +@@ -320,6 +321,8 @@ private:
407 + nsresult DispatchTransaction(nsConnectionEntry *, nsHttpTransaction *,
408 PRUint8 caps, nsHttpConnection *);
409 bool BuildPipeline(nsConnectionEntry *, nsAHttpTransaction *, nsHttpPipeline **);
410 + bool BuildRandomizedPipeline(nsConnectionEntry *, nsAHttpTransaction *, nsHttpPipeline **);
411 @@ -237,15 +237,15 @@
412 nsresult ProcessNewTransaction(nsHttpTransaction *);
413 nsresult EnsureSocketThreadTargetIfOnline();
414 void ClosePersistentConnections(nsConnectionEntry *ent);
415 -@@ -353,6 +356,8 @@ private:
416 +@@ -412,6 +415,8 @@ private:
417 PRUint64 mTimeOfNextWakeUp;
418 // Timer for next pruning of dead connections.
419 nsCOMPtr<nsITimer> mTimer;
420 + // Random number generator for reordering HTTP pipeline
421 + nsCOMPtr<nsIRandomGenerator> mRandomGenerator;
422
423 - //
424 - // the connection table
425 + // A 1s tick to call nsHttpConnection::ReadTimeoutTick on
426 + // active http/1 connections. Disabled when there are no
427 --
428 1.7.5.4
429
430
431
432
433 1.2 www-client/torbrowser/files/torbrowser-patches/0006-Make-content-pref-service-memory-only-clearable.patch
434
435 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0006-Make-content-pref-service-memory-only-clearable.patch?rev=1.2&view=markup
436 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0006-Make-content-pref-service-memory-only-clearable.patch?rev=1.2&content-type=text/plain
437 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0006-Make-content-pref-service-memory-only-clearable.patch?r1=1.1&r2=1.2
438
439 Index: 0006-Make-content-pref-service-memory-only-clearable.patch
440 ===================================================================
441 RCS file: /var/cvsroot/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0006-Make-content-pref-service-memory-only-clearable.patch,v
442 retrieving revision 1.1
443 retrieving revision 1.2
444 diff -u -r1.1 -r1.2
445 --- 0006-Make-content-pref-service-memory-only-clearable.patch 6 Jun 2012 22:21:08 -0000 1.1
446 +++ 0006-Make-content-pref-service-memory-only-clearable.patch 30 Jun 2012 20:43:10 -0000 1.2
447 @@ -1,7 +1,7 @@
448 -From 66ff6c30d5b1de5d549181acbba686f792fe4cb4 Mon Sep 17 00:00:00 2001
449 +From bd560666419266a862d5b0387c7941c8ef7bb624 Mon Sep 17 00:00:00 2001
450 From: Mike Perry <mikeperry-git@××××××.org>
451 Date: Thu, 8 Sep 2011 08:40:17 -0700
452 -Subject: [PATCH 06/18] Make content pref service memory-only + clearable
453 +Subject: [PATCH 06/20] Make content pref service memory-only + clearable
454
455 This prevents random urls from being inserted into content-prefs.sqllite in
456 the profile directory as content prefs change (includes site-zoom and perhaps
457 @@ -11,10 +11,10 @@
458 1 files changed, 2 insertions(+), 2 deletions(-)
459
460 diff --git a/toolkit/components/contentprefs/nsContentPrefService.js b/toolkit/components/contentprefs/nsContentPrefService.js
461 -index adfb650..1619d5f 100644
462 +index 68a5561..effc33c 100644
463 --- a/toolkit/components/contentprefs/nsContentPrefService.js
464 +++ b/toolkit/components/contentprefs/nsContentPrefService.js
465 -@@ -1240,7 +1240,7 @@ ContentPrefService.prototype = {
466 +@@ -1242,7 +1242,7 @@ ContentPrefService.prototype = {
467
468 var dbConnection;
469
470 @@ -23,7 +23,7 @@
471 dbConnection = this._dbCreate(dbService, dbFile);
472 else {
473 try {
474 -@@ -1288,7 +1288,7 @@ ContentPrefService.prototype = {
475 +@@ -1290,7 +1290,7 @@ ContentPrefService.prototype = {
476 },
477
478 _dbCreate: function ContentPrefService__dbCreate(aDBService, aDBFile) {
479
480
481
482 1.2 www-client/torbrowser/files/torbrowser-patches/0002-Make-Permissions-Manager-memory-only.patch
483
484 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0002-Make-Permissions-Manager-memory-only.patch?rev=1.2&view=markup
485 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0002-Make-Permissions-Manager-memory-only.patch?rev=1.2&content-type=text/plain
486 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0002-Make-Permissions-Manager-memory-only.patch?r1=1.1&r2=1.2
487
488 Index: 0002-Make-Permissions-Manager-memory-only.patch
489 ===================================================================
490 RCS file: /var/cvsroot/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0002-Make-Permissions-Manager-memory-only.patch,v
491 retrieving revision 1.1
492 retrieving revision 1.2
493 diff -u -r1.1 -r1.2
494 --- 0002-Make-Permissions-Manager-memory-only.patch 6 Jun 2012 22:21:08 -0000 1.1
495 +++ 0002-Make-Permissions-Manager-memory-only.patch 30 Jun 2012 20:43:10 -0000 1.2
496 @@ -1,7 +1,7 @@
497 -From 336217485d707ff63ef42d2a0bc3705c2c7f7a3c Mon Sep 17 00:00:00 2001
498 +From 4c65de64fc28ca767009a0d0acfcefd8f2a73ad8 Mon Sep 17 00:00:00 2001
499 From: Mike Perry <mikeperry-git@××××××××××.org>
500 Date: Wed, 1 Feb 2012 15:45:16 -0800
501 -Subject: [PATCH 02/18] Make Permissions Manager memory-only
502 +Subject: [PATCH 02/20] Make Permissions Manager memory-only
503
504 This patch exposes a pref 'permissions.memory_only' that properly isolates the
505 permissions manager to memory, which is responsible for all user specified
506 @@ -16,7 +16,7 @@
507 1 files changed, 31 insertions(+), 3 deletions(-)
508
509 diff --git a/extensions/cookie/nsPermissionManager.cpp b/extensions/cookie/nsPermissionManager.cpp
510 -index 67eb216..12cc7cf 100644
511 +index cdfe21b..a7a0efb 100644
512 --- a/extensions/cookie/nsPermissionManager.cpp
513 +++ b/extensions/cookie/nsPermissionManager.cpp
514 @@ -58,6 +58,10 @@
515 @@ -75,7 +75,7 @@
516 NS_ENSURE_SUCCESS(rv, rv);
517
518 mDBConn->GetConnectionReady(&ready);
519 -@@ -783,7 +806,12 @@ NS_IMETHODIMP nsPermissionManager::Observe(nsISupports *aSubject, const char *aT
520 +@@ -794,7 +817,12 @@ NS_IMETHODIMP nsPermissionManager::Observe(nsISupports *aSubject, const char *aT
521 {
522 ENSURE_NOT_CHILD_PROCESS;
523
524
525
526
527 1.1 www-client/torbrowser/files/torbrowser-patches/0011-Make-Download-manager-memory-only.patch
528
529 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0011-Make-Download-manager-memory-only.patch?rev=1.1&view=markup
530 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0011-Make-Download-manager-memory-only.patch?rev=1.1&content-type=text/plain
531
532 Index: 0011-Make-Download-manager-memory-only.patch
533 ===================================================================
534 From 8992ae1cb7e1545413e649027ab7827799c53300 Mon Sep 17 00:00:00 2001
535 From: Mike Perry <mikeperry-git@××××××××××.org>
536 Date: Wed, 25 Apr 2012 13:39:35 -0700
537 Subject: [PATCH 11/20] Make Download manager memory only.
538
539 Solves https://trac.torproject.org/projects/tor/ticket/4017.
540
541 Yes, this is an ugly hack. We *could* send the observer notification from
542 Torbutton to tell the download manager to switch to memory, but then we have
543 to dance around and tell it again if the user switches in and out of private
544 browsing mode..
545
546 The right way to do this is with a pref. Maybe I'll get to that someday, if
547 this breaks enough times in conflict.
548 ---
549 toolkit/components/downloads/nsDownloadManager.cpp | 4 ++--
550 toolkit/components/downloads/nsDownloadManager.h | 2 +-
551 2 files changed, 3 insertions(+), 3 deletions(-)
552
553 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
554 index cb1f1f6..1de653b 100644
555 --- a/toolkit/components/downloads/nsDownloadManager.cpp
556 +++ b/toolkit/components/downloads/nsDownloadManager.cpp
557 @@ -1999,7 +1999,7 @@ nsDownloadManager::Observe(nsISupports *aSubject,
558 if (NS_LITERAL_STRING("memory").Equals(aData))
559 return SwitchDatabaseTypeTo(DATABASE_MEMORY);
560 else if (NS_LITERAL_STRING("disk").Equals(aData))
561 - return SwitchDatabaseTypeTo(DATABASE_DISK);
562 + return SwitchDatabaseTypeTo(DATABASE_MEMORY);
563 }
564 else if (strcmp(aTopic, "alertclickcallback") == 0) {
565 nsCOMPtr<nsIDownloadManagerUI> dmui =
566 @@ -2076,7 +2076,7 @@ nsDownloadManager::OnLeavePrivateBrowsingMode()
567 (void)ResumeAllDownloads(false);
568
569 // Switch back to the on-disk DB again
570 - (void)SwitchDatabaseTypeTo(DATABASE_DISK);
571 + //(void)SwitchDatabaseTypeTo(DATABASE_DISK);
572
573 mInPrivateBrowsing = false;
574 }
575 diff --git a/toolkit/components/downloads/nsDownloadManager.h b/toolkit/components/downloads/nsDownloadManager.h
576 index 16a861e..e729cbf 100644
577 --- a/toolkit/components/downloads/nsDownloadManager.h
578 +++ b/toolkit/components/downloads/nsDownloadManager.h
579 @@ -92,7 +92,7 @@ public:
580
581 virtual ~nsDownloadManager();
582 nsDownloadManager() :
583 - mDBType(DATABASE_DISK)
584 + mDBType(DATABASE_MEMORY)
585 , mInPrivateBrowsing(false)
586 #ifdef DOWNLOAD_SCANNER
587 , mScanner(nsnull)
588 --
589 1.7.5.4
590
591
592
593
594 1.1 www-client/torbrowser/files/torbrowser-patches/0020-Fix-internal-compile-error-for-sub-ancient-GCCs.patch
595
596 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0020-Fix-internal-compile-error-for-sub-ancient-GCCs.patch?rev=1.1&view=markup
597 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0020-Fix-internal-compile-error-for-sub-ancient-GCCs.patch?rev=1.1&content-type=text/plain
598
599 Index: 0020-Fix-internal-compile-error-for-sub-ancient-GCCs.patch
600 ===================================================================
601 From fb210909f6fd3a4a5253101d44edc8c884bf6c04 Mon Sep 17 00:00:00 2001
602 From: Mike Perry <mikeperry-git@××××××××××.org>
603 Date: Wed, 20 Jun 2012 15:26:11 -0700
604 Subject: [PATCH 20/20] Fix 'internal compile error' for sub-ancient GCCs.
605
606 Also fix a related null pointer deref.
607 ---
608 netwerk/protocol/http/HttpChannelParent.cpp | 13 ++++++++++---
609 1 files changed, 10 insertions(+), 3 deletions(-)
610
611 diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp
612 index c0d2fff..982c4e0 100644
613 --- a/netwerk/protocol/http/HttpChannelParent.cpp
614 +++ b/netwerk/protocol/http/HttpChannelParent.cpp
615 @@ -333,8 +333,13 @@ HttpChannelParent::RecvUpdateAssociatedContentSecurity(const PRInt32& high,
616
617 // Bug 621446 investigation, we don't want conditional PR_Aborts bellow to be
618 // merged to a single address.
619 -#pragma warning(disable : 4068)
620 +// Compiling with a version of GCC <= 4.4 fails with an internal compiler
621 +// error.
622 +#if !defined(__GNUC__) || \
623 + (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
624 #pragma GCC optimize ("O0")
625 +#pragma warning(disable : 4068)
626 +#endif
627
628 bool
629 HttpChannelParent::RecvRedirect2Verify(const nsresult& result,
630 @@ -369,8 +374,10 @@ HttpChannelParent::RecvRedirect2Verify(const nsresult& result,
631
632 mReceivedRedirect2Verify = true;
633
634 - mRedirectCallback->OnRedirectVerifyCallback(result);
635 - mRedirectCallback = nsnull;
636 + if (mRedirectCallback) {
637 + mRedirectCallback->OnRedirectVerifyCallback(result);
638 + mRedirectCallback = nsnull;
639 + }
640 return true;
641 }
642
643 --
644 1.7.5.4
645
646
647
648
649 1.1 www-client/torbrowser/files/torbrowser-patches/0009-Limit-device-and-system-specific-CSS-Media-Queries.patch
650
651 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0009-Limit-device-and-system-specific-CSS-Media-Queries.patch?rev=1.1&view=markup
652 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0009-Limit-device-and-system-specific-CSS-Media-Queries.patch?rev=1.1&content-type=text/plain
653
654 Index: 0009-Limit-device-and-system-specific-CSS-Media-Queries.patch
655 ===================================================================
656 From 6c09a21d1db29dc28b359294ededc047ba5b463e Mon Sep 17 00:00:00 2001
657 From: Shondoit Walker <shondoit@×××××.com>
658 Date: Mon, 4 Jun 2012 19:15:31 +0200
659 Subject: [PATCH 09/20] Limit device- and system-specific CSS Media Queries
660
661 This is done to address
662 https://www.torproject.org/projects/torbrowser/design/#fingerprinting-linkability
663
664 This also fixes bug #4795 by making queries still available for chrome windows,
665 whilst returning nothing or non-device-specific values for web pages or extensions.
666 ---
667 layout/style/nsMediaFeatures.cpp | 42 ++++++++++++++++++++++++-------------
668 1 files changed, 27 insertions(+), 15 deletions(-)
669
670 diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp
671 index 6eca06e..25735e8 100644
672 --- a/layout/style/nsMediaFeatures.cpp
673 +++ b/layout/style/nsMediaFeatures.cpp
674 @@ -130,6 +130,9 @@ GetDeviceContextFor(nsPresContext* aPresContext)
675 static nsSize
676 GetDeviceSize(nsPresContext* aPresContext)
677 {
678 + if (!aPresContext->IsChrome()) {
679 + return GetSize(aPresContext);
680 + } else {
681 nsSize size;
682 if (aPresContext->IsRootPaginatedDocument())
683 // We want the page size, including unprintable areas and margins.
684 @@ -140,6 +143,7 @@ GetDeviceSize(nsPresContext* aPresContext)
685 GetDeviceContextFor(aPresContext)->
686 GetDeviceSurfaceDimensions(size.width, size.height);
687 return size;
688 + }
689 }
690
691 static nsresult
692 @@ -183,17 +187,17 @@ static nsresult
693 GetDeviceOrientation(nsPresContext* aPresContext, const nsMediaFeature*,
694 nsCSSValue& aResult)
695 {
696 - nsSize size = GetDeviceSize(aPresContext);
697 - PRInt32 orientation;
698 - if (size.width > size.height) {
699 - orientation = NS_STYLE_ORIENTATION_LANDSCAPE;
700 - } else {
701 - // Per spec, square viewports should be 'portrait'
702 - orientation = NS_STYLE_ORIENTATION_PORTRAIT;
703 - }
704 -
705 - aResult.SetIntValue(orientation, eCSSUnit_Enumerated);
706 - return NS_OK;
707 + nsSize size = GetDeviceSize(aPresContext);
708 + PRInt32 orientation;
709 + if (size.width > size.height) {
710 + orientation = NS_STYLE_ORIENTATION_LANDSCAPE;
711 + } else {
712 + // Per spec, square viewports should be 'portrait'
713 + orientation = NS_STYLE_ORIENTATION_PORTRAIT;
714 + }
715 +
716 + aResult.SetIntValue(orientation, eCSSUnit_Enumerated);
717 + return NS_OK;
718 }
719
720 static nsresult
721 @@ -311,8 +315,12 @@ static nsresult
722 GetDevicePixelRatio(nsPresContext* aPresContext, const nsMediaFeature*,
723 nsCSSValue& aResult)
724 {
725 - float ratio = aPresContext->CSSPixelsToDevPixels(1.0f);
726 - aResult.SetFloatValue(ratio, eCSSUnit_Number);
727 + if (aPresContext->IsChrome()) {
728 + float ratio = aPresContext->CSSPixelsToDevPixels(1.0f);
729 + aResult.SetFloatValue(ratio, eCSSUnit_Number);
730 + } else {
731 + aResult.SetFloatValue(1.0, eCSSUnit_Number);
732 + }
733 return NS_OK;
734 }
735
736 @@ -320,18 +328,21 @@ static nsresult
737 GetSystemMetric(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
738 nsCSSValue& aResult)
739 {
740 + if (aPresContext->IsChrome()) {
741 NS_ABORT_IF_FALSE(aFeature->mValueType == nsMediaFeature::eBoolInteger,
742 "unexpected type");
743 nsIAtom *metricAtom = *aFeature->mData.mMetric;
744 bool hasMetric = nsCSSRuleProcessor::HasSystemMetric(metricAtom);
745 aResult.SetIntValue(hasMetric ? 1 : 0, eCSSUnit_Integer);
746 - return NS_OK;
747 + }
748 + return NS_OK;
749 }
750
751 static nsresult
752 GetWindowsTheme(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
753 nsCSSValue& aResult)
754 {
755 + if (aPresContext->IsChrome()) {
756 aResult.Reset();
757 #ifdef XP_WIN
758 PRUint8 windowsThemeId =
759 @@ -350,7 +361,8 @@ GetWindowsTheme(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
760 }
761 }
762 #endif
763 - return NS_OK;
764 + }
765 + return NS_OK;
766 }
767
768 /*
769 --
770 1.7.5.4
771
772
773
774
775 1.1 www-client/torbrowser/files/torbrowser-patches/0010-Rebrand-Firefox-to-TorBrowser.patch
776
777 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0010-Rebrand-Firefox-to-TorBrowser.patch?rev=1.1&view=markup
778 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0010-Rebrand-Firefox-to-TorBrowser.patch?rev=1.1&content-type=text/plain
779
780 Index: 0010-Rebrand-Firefox-to-TorBrowser.patch
781 ===================================================================
782 From 622437f3baf410f14610b21bcca7f9a0fcc8c6d9 Mon Sep 17 00:00:00 2001
783 From: Erinn Clark <erinn@××××××××××.org>
784 Date: Wed, 25 Apr 2012 09:14:00 -0300
785 Subject: [PATCH 10/20] Rebrand Firefox to TorBrowser
786
787 This patch does some basic renaming of Firefox to TorBrowser. The rest of the
788 branding is done by images and icons.
789 ---
790 browser/branding/official/configure.sh | 2 +-
791 browser/branding/official/locales/en-US/brand.dtd | 6 +++---
792 .../official/locales/en-US/brand.properties | 6 +++---
793 3 files changed, 7 insertions(+), 7 deletions(-)
794
795 diff --git a/browser/branding/official/configure.sh b/browser/branding/official/configure.sh
796 index 4d3d297..e9b3738 100644
797 --- a/browser/branding/official/configure.sh
798 +++ b/browser/branding/official/configure.sh
799 @@ -1,2 +1,2 @@
800 -MOZ_APP_DISPLAYNAME=Firefox
801 +MOZ_APP_DISPLAYNAME=TorBrowser
802 MOZ_UA_BUILDID=20100101
803 diff --git a/browser/branding/official/locales/en-US/brand.dtd b/browser/branding/official/locales/en-US/brand.dtd
804 index 142d79b..c137e04 100644
805 --- a/browser/branding/official/locales/en-US/brand.dtd
806 +++ b/browser/branding/official/locales/en-US/brand.dtd
807 @@ -1,4 +1,4 @@
808 -<!ENTITY brandShortName "Firefox">
809 -<!ENTITY brandFullName "Mozilla Firefox">
810 -<!ENTITY vendorShortName "Mozilla">
811 +<!ENTITY brandShortName "TorBrowser">
812 +<!ENTITY brandFullName "Tor Browser">
813 +<!ENTITY vendorShortName "Tor Project">
814 <!ENTITY trademarkInfo.part1 "Firefox and the Firefox logos are trademarks of the Mozilla Foundation.">
815 diff --git a/browser/branding/official/locales/en-US/brand.properties b/browser/branding/official/locales/en-US/brand.properties
816 index 5f3ad54..62ac2fd 100644
817 --- a/browser/branding/official/locales/en-US/brand.properties
818 +++ b/browser/branding/official/locales/en-US/brand.properties
819 @@ -1,6 +1,6 @@
820 -brandShortName=Firefox
821 -brandFullName=Mozilla Firefox
822 -vendorShortName=Mozilla
823 +brandShortName=TorBrowser
824 +brandFullName=Tor Browser
825 +vendorShortName=Tor Project
826
827 homePageSingleStartMain=Firefox Start, a fast home page with built-in search
828 homePageImport=Import your home page from %S
829 --
830 1.7.5.4
831
832
833
834
835 1.1 www-client/torbrowser/files/torbrowser-patches/0015-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
836
837 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0015-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch?rev=1.1&view=markup
838 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0015-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch?rev=1.1&content-type=text/plain
839
840 Index: 0015-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
841 ===================================================================
842 From c482a4bd10c58099f7bab0c5990c6e5a29b6c59d Mon Sep 17 00:00:00 2001
843 From: Mike Perry <mikeperry-git@××××××××××.org>
844 Date: Thu, 7 Jun 2012 14:45:26 -0700
845 Subject: [PATCH 15/20] Make Tor Browser exit when not launched from Vidalia
846
847 Turns out the Windows 7 UI encourages users to "dock" their Tor Browser app
848 for easy relaunch. If they manage to do this, we should fail closed rather
849 than opened. Hopefully they will get the hint and dock Vidalia instead.
850
851 This is an emergency fix for
852 https://trac.torproject.org/projects/tor/ticket/4192. We can do a better
853 localized fix w/ a translated alert menu later, if it seems like this might
854 actually be common.
855 ---
856 browser/base/content/browser.js | 14 ++++++++++++++
857 1 files changed, 14 insertions(+), 0 deletions(-)
858
859 diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
860 index 6e254ca..57ca373 100644
861 --- a/browser/base/content/browser.js
862 +++ b/browser/base/content/browser.js
863 @@ -1234,6 +1234,20 @@ function BrowserStartup() {
864
865 prepareForStartup();
866
867 + // If this is not a TBB profile, exit.
868 + // Solves https://trac.torproject.org/projects/tor/ticket/4192
869 + var foundPref = false;
870 + try {
871 + foundPref = gPrefService.prefHasUserValue("torbrowser.version");
872 + } catch(e) {
873 + //dump("No pref: "+e);
874 + }
875 + if(!foundPref) {
876 + var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"]
877 + .getService(Components.interfaces.nsIAppStartup);
878 + appStartup.quit(3); // Force all windows to close, and then quit.
879 + }
880 +
881 if (uriToLoad && uriToLoad != "about:blank") {
882 if (uriToLoad instanceof Ci.nsISupportsArray) {
883 let count = uriToLoad.Count();
884 --
885 1.7.5.4
886
887
888
889
890 1.1 www-client/torbrowser/files/torbrowser-patches/0018-Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch
891
892 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0018-Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch?rev=1.1&view=markup
893 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0018-Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch?rev=1.1&content-type=text/plain
894
895 Index: 0018-Adapt-Steven-Michaud-s-Mac-crashfix-patch.patch
896 ===================================================================
897 From 7c321c4d75c7c80d899db962804d288ed7db162e Mon Sep 17 00:00:00 2001
898 From: Mike Perry <mikeperry-git@××××××××××.org>
899 Date: Thu, 7 Jun 2012 15:26:13 -0700
900 Subject: [PATCH 18/20] Adapt Steven Michaud's Mac crashfix patch
901
902 Source is: https://bugzilla.mozilla.org/show_bug.cgi?id=715885#c35
903
904 Some minor tweaks were needed to get it to apply and to compile on
905 MacOS.
906 ---
907 widget/Makefile.in | 1 +
908 widget/cocoa/nsChildView.mm | 28 +++++++++++------
909 widget/gtk2/nsDragService.cpp | 2 +-
910 widget/gtk2/nsWindow.cpp | 2 +-
911 widget/nsIDragService.idl | 4 +--
912 widget/nsPIDragService.idl | 48 +++++++++++++++++++++++++++++
913 widget/qt/nsDragService.h | 2 +
914 widget/windows/Makefile.in | 4 ++
915 widget/windows/nsDragService.cpp | 13 +++++---
916 widget/windows/nsDragService.h | 12 +++---
917 widget/windows/nsNativeDragSource.cpp | 7 ++--
918 widget/windows/nsNativeDragTarget.cpp | 28 ++++++++++------
919 widget/windows/nsPIDragServiceWindows.idl | 46 +++++++++++++++++++++++++++
920 widget/xpwidgets/nsBaseDragService.cpp | 16 +++++++++-
921 widget/xpwidgets/nsBaseDragService.h | 9 ++---
922 15 files changed, 176 insertions(+), 46 deletions(-)
923 create mode 100644 widget/nsPIDragService.idl
924 create mode 100644 widget/windows/nsPIDragServiceWindows.idl
925
926 diff --git a/widget/Makefile.in b/widget/Makefile.in
927 index 4a3405b..4c105a4 100644
928 --- a/widget/Makefile.in
929 +++ b/widget/Makefile.in
930 @@ -138,6 +138,7 @@ XPIDLSRCS = \
931 nsIClipboardDragDropHooks.idl \
932 nsIClipboardDragDropHookList.idl \
933 nsIDragSession.idl \
934 + nsPIDragService.idl \
935 nsIDragService.idl \
936 nsIFormatConverter.idl \
937 nsIClipboard.idl \
938 diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
939 index 0db6b1c..8d59716 100644
940 --- a/widget/cocoa/nsChildView.mm
941 +++ b/widget/cocoa/nsChildView.mm
942 @@ -4555,11 +4555,12 @@ NSEvent* gLastDragMouseDownEvent = nil;
943 if (!dragService) {
944 dragService = do_GetService(kDragServiceContractID);
945 }
946 + nsCOMPtr<nsPIDragService> dragServicePriv = do_QueryInterface(dragService);
947
948 if (dragService) {
949 NSPoint pnt = [NSEvent mouseLocation];
950 FlipCocoaScreenCoordinate(pnt);
951 - dragService->DragMoved(NSToIntRound(pnt.x), NSToIntRound(pnt.y));
952 + dragServicePriv->DragMoved(NSToIntRound(pnt.x), NSToIntRound(pnt.y));
953 }
954 }
955
956 @@ -4580,11 +4581,13 @@ NSEvent* gLastDragMouseDownEvent = nil;
957 }
958
959 if (mDragService) {
960 - // set the dragend point from the current mouse location
961 - nsDragService* dragService = static_cast<nsDragService *>(mDragService);
962 - NSPoint pnt = [NSEvent mouseLocation];
963 - FlipCocoaScreenCoordinate(pnt);
964 - dragService->SetDragEndPoint(nsIntPoint(NSToIntRound(pnt.x), NSToIntRound(pnt.y)));
965 + nsCOMPtr<nsPIDragService> dragServicePriv = do_QueryInterface(mDragService);
966 + if (dragServicePriv) {
967 + // set the dragend point from the current mouse location
968 + NSPoint pnt = [NSEvent mouseLocation];
969 + FlipCocoaScreenCoordinate(pnt);
970 + dragServicePriv->SetDragEndPoint(NSToIntRound(pnt.x), NSToIntRound(pnt.y));
971 + }
972
973 // XXX: dropEffect should be updated per |operation|.
974 // As things stand though, |operation| isn't well handled within "our"
975 @@ -4595,10 +4598,15 @@ NSEvent* gLastDragMouseDownEvent = nil;
976 // value for NSDragOperationGeneric that is passed by other applications.
977 // All that said, NSDragOperationNone is still reliable.
978 if (operation == NSDragOperationNone) {
979 - nsCOMPtr<nsIDOMDataTransfer> dataTransfer;
980 - dragService->GetDataTransfer(getter_AddRefs(dataTransfer));
981 - if (dataTransfer)
982 - dataTransfer->SetDropEffectInt(nsIDragService::DRAGDROP_ACTION_NONE);
983 + nsCOMPtr<nsIDragSession> dragSession;
984 + mDragService->GetCurrentSession(getter_AddRefs(dragSession));
985 + if (dragSession) {
986 + nsCOMPtr<nsIDOMDataTransfer> dataTransfer;
987 + dragSession->GetDataTransfer(getter_AddRefs(dataTransfer));
988 + if (dataTransfer) {
989 + dataTransfer->SetDropEffectInt(nsIDragService::DRAGDROP_ACTION_NONE);
990 + }
991 + }
992 }
993
994 mDragService->EndDragSession(true);
995 diff --git a/widget/gtk2/nsDragService.cpp b/widget/gtk2/nsDragService.cpp
996 index be8f388..99d3878 100644
997 --- a/widget/gtk2/nsDragService.cpp
998 +++ b/widget/gtk2/nsDragService.cpp
999 @@ -1332,7 +1332,7 @@ nsDragService::SourceEndDragSession(GdkDragContext *aContext,
1000 GdkDisplay* display = gdk_display_get_default();
1001 if (display) {
1002 gdk_display_get_pointer(display, NULL, &x, &y, NULL);
1003 - SetDragEndPoint(nsIntPoint(x, y));
1004 + SetDragEndPoint(x, y);
1005 }
1006
1007 // Either the drag was aborted or the drop occurred outside the app.
1008 diff --git a/widget/gtk2/nsWindow.cpp b/widget/gtk2/nsWindow.cpp
1009 index 9de734e..81fe553 100644
1010 --- a/widget/gtk2/nsWindow.cpp
1011 +++ b/widget/gtk2/nsWindow.cpp
1012 @@ -3517,7 +3517,7 @@ nsWindow::OnDragDropEvent(GtkWidget *aWidget,
1013 if (display) {
1014 // get the current cursor position
1015 gdk_display_get_pointer(display, NULL, &x, &y, NULL);
1016 - ((nsDragService *)dragService.get())->SetDragEndPoint(nsIntPoint(x, y));
1017 + ((nsDragService *)dragService.get())->SetDragEndPoint(x, y);
1018 }
1019 dragService->EndDragSession(true);
1020
1021 diff --git a/widget/nsIDragService.idl b/widget/nsIDragService.idl
1022 index e42c578..ef8c46f 100644
1023 --- a/widget/nsIDragService.idl
1024 +++ b/widget/nsIDragService.idl
1025 @@ -48,7 +48,7 @@ interface nsIDOMDragEvent;
1026 interface nsIDOMDataTransfer;
1027 interface nsISelection;
1028
1029 -[scriptable, uuid(82B58ADA-F490-4C3D-B737-1057C4F1D052), builtinclass]
1030 +[scriptable, uuid(82B58ADA-F490-4C3D-B737-1057C4F1D052)]
1031 interface nsIDragService : nsISupports
1032 {
1033 const long DRAGDROP_ACTION_NONE = 0;
1034 @@ -145,8 +145,6 @@ interface nsIDragService : nsISupports
1035 */
1036 void suppress();
1037 void unsuppress();
1038 -
1039 - [noscript] void dragMoved(in long aX, in long aY);
1040 };
1041
1042
1043 diff --git a/widget/nsPIDragService.idl b/widget/nsPIDragService.idl
1044 new file mode 100644
1045 index 0000000..93a144d
1046 --- /dev/null
1047 +++ b/widget/nsPIDragService.idl
1048 @@ -0,0 +1,48 @@
1049 +/* ***** BEGIN LICENSE BLOCK *****
1050 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1051 + *
1052 + * The contents of this file are subject to the Mozilla Public License Version
1053 + * 1.1 (the "License"); you may not use this file except in compliance with
1054 + * the License. You may obtain a copy of the License at
1055 + * http://www.mozilla.org/MPL/
1056 + *
1057 + * Software distributed under the License is distributed on an "AS IS" basis,
1058 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1059 + * for the specific language governing rights and limitations under the
1060 + * License.
1061 + *
1062 + * The Original Code is mozilla.org code.
1063 + *
1064 + * The Initial Developer of the Original Code is
1065 + * The Mozilla Foundation.
1066 + * Portions created by the Initial Developer are Copyright (C) 2012
1067 + * the Initial Developer. All Rights Reserved.
1068 + *
1069 + * Contributor(s):
1070 + * Steven Michaud <smichaud@×××××.com>
1071 + *
1072 + * Alternatively, the contents of this file may be used under the terms of
1073 + * either the GNU General Public License Version 2 or later (the "GPL"), or
1074 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1075 + * in which case the provisions of the GPL or the LGPL are applicable instead
1076 + * of those above. If you wish to allow use of your version of this file only
1077 + * under the terms of either the GPL or the LGPL, and not to allow others to
1078 + * use your version of this file under the terms of the MPL, indicate your
1079 + * decision by deleting the provisions above and replace them with the notice
1080 + * and other provisions required by the GPL or the LGPL. If you do not delete
1081 + * the provisions above, a recipient may use your version of this file under
1082 + * the terms of any one of the MPL, the GPL or the LGPL.
1083 + *
1084 + * ***** END LICENSE BLOCK ***** */
1085 +
1086 +#include "nsISupports.idl"
1087 +
1088 +[scriptable, uuid(FAD8C90B-8E1D-446A-9B6C-241486A85CBD)]
1089 +interface nsPIDragService : nsISupports
1090 +{
1091 + void dragMoved(in long aX, in long aY);
1092 +
1093 + PRUint16 getInputSource();
1094 +
1095 + void setDragEndPoint(in long aX, in long aY);
1096 +};
1097 diff --git a/widget/qt/nsDragService.h b/widget/qt/nsDragService.h
1098 index 5a3e5bb..50dcfac 100644
1099 --- a/widget/qt/nsDragService.h
1100 +++ b/widget/qt/nsDragService.h
1101 @@ -50,6 +50,8 @@ public:
1102 NS_DECL_ISUPPORTS
1103 NS_DECL_NSIDRAGSERVICE
1104
1105 + NS_IMETHOD DragMoved(PRInt32 aX, PRInt32 aY);
1106 +
1107 nsDragService();
1108
1109 private:
1110 diff --git a/widget/windows/Makefile.in b/widget/windows/Makefile.in
1111 index df811ac..8d5ea4b 100644
1112 --- a/widget/windows/Makefile.in
1113 +++ b/widget/windows/Makefile.in
1114 @@ -120,6 +120,10 @@ ifdef MOZ_ENABLE_D3D10_LAYER
1115 DEFINES += -DMOZ_ENABLE_D3D10_LAYER
1116 endif
1117
1118 +XPIDLSRCS += \
1119 + nsPIDragServiceWindows.idl \
1120 + $(NULL)
1121 +
1122 SHARED_LIBRARY_LIBS = \
1123 ../xpwidgets/$(LIB_PREFIX)xpwidgets_s.$(LIB_SUFFIX) \
1124 $(NULL)
1125 diff --git a/widget/windows/nsDragService.cpp b/widget/windows/nsDragService.cpp
1126 index b6b5b62..9657263 100644
1127 --- a/widget/windows/nsDragService.cpp
1128 +++ b/widget/windows/nsDragService.cpp
1129 @@ -97,6 +97,8 @@ nsDragService::~nsDragService()
1130 NS_IF_RELEASE(mDataObject);
1131 }
1132
1133 +NS_IMPL_ISUPPORTS_INHERITED1(nsDragService, nsBaseDragService, nsPIDragServiceWindows)
1134 +
1135 bool
1136 nsDragService::CreateDragImage(nsIDOMNode *aDOMNode,
1137 nsIScriptableRegion *aRegion,
1138 @@ -347,7 +349,7 @@ nsDragService::StartInvokingDragSession(IDataObject * aDataObj,
1139 POINT cpos;
1140 cpos.x = GET_X_LPARAM(pos);
1141 cpos.y = GET_Y_LPARAM(pos);
1142 - SetDragEndPoint(nsIntPoint(cpos.x, cpos.y));
1143 + SetDragEndPoint(cpos.x, cpos.y);
1144 EndDragSession(true);
1145
1146 mDoingDrag = false;
1147 @@ -465,25 +467,26 @@ nsDragService::GetData(nsITransferable * aTransferable, PRUint32 anItem)
1148
1149 //---------------------------------------------------------
1150 NS_IMETHODIMP
1151 -nsDragService::SetIDataObject(IDataObject * aDataObj)
1152 +nsDragService::SetIDataObject(nsISupports * aDataObj)
1153 {
1154 + IDataObject *dataObj = (IDataObject*) aDataObj;
1155 // When the native drag starts the DragService gets
1156 // the IDataObject that is being dragged
1157 NS_IF_RELEASE(mDataObject);
1158 - mDataObject = aDataObj;
1159 + mDataObject = dataObj;
1160 NS_IF_ADDREF(mDataObject);
1161
1162 return NS_OK;
1163 }
1164
1165 //---------------------------------------------------------
1166 -void
1167 +NS_IMETHODIMP
1168 nsDragService::SetDroppedLocal()
1169 {
1170 // Sent from the native drag handler, letting us know
1171 // a drop occurred within the application vs. outside of it.
1172 mSentLocalDropEvent = true;
1173 - return;
1174 + return NS_OK;
1175 }
1176
1177 //-------------------------------------------------------------------------
1178 diff --git a/widget/windows/nsDragService.h b/widget/windows/nsDragService.h
1179 index 87d6cc9..04c8746 100644
1180 --- a/widget/windows/nsDragService.h
1181 +++ b/widget/windows/nsDragService.h
1182 @@ -39,6 +39,7 @@
1183 #define nsDragService_h__
1184
1185 #include "nsBaseDragService.h"
1186 +#include "nsPIDragServiceWindows.h"
1187 #include <windows.h>
1188 #include <shlobj.h>
1189
1190 @@ -52,12 +53,15 @@ class nsString;
1191 * Native Win32 DragService wrapper
1192 */
1193
1194 -class nsDragService : public nsBaseDragService
1195 +class nsDragService : public nsBaseDragService, public nsPIDragServiceWindows
1196 {
1197 public:
1198 nsDragService();
1199 virtual ~nsDragService();
1200 -
1201 +
1202 + NS_DECL_ISUPPORTS_INHERITED
1203 + NS_DECL_NSPIDRAGSERVICEWINDOWS
1204 +
1205 // nsIDragService
1206 NS_IMETHOD InvokeDragSession(nsIDOMNode *aDOMNode,
1207 nsISupportsArray *anArrayTransferables,
1208 @@ -71,13 +75,9 @@ public:
1209 NS_IMETHOD EndDragSession(bool aDoneDrag);
1210
1211 // native impl.
1212 - NS_IMETHOD SetIDataObject(IDataObject * aDataObj);
1213 NS_IMETHOD StartInvokingDragSession(IDataObject * aDataObj,
1214 PRUint32 aActionType);
1215
1216 - // A drop occurred within the application vs. outside of it.
1217 - void SetDroppedLocal();
1218 -
1219 protected:
1220 nsDataObjCollection* GetDataObjCollection(IDataObject * aDataObj);
1221
1222 diff --git a/widget/windows/nsNativeDragSource.cpp b/widget/windows/nsNativeDragSource.cpp
1223 index e51101e..0fe6ffe 100644
1224 --- a/widget/windows/nsNativeDragSource.cpp
1225 +++ b/widget/windows/nsNativeDragSource.cpp
1226 @@ -42,7 +42,7 @@
1227 #include "nsIServiceManager.h"
1228 #include "nsToolkit.h"
1229 #include "nsWidgetsCID.h"
1230 -#include "nsIDragService.h"
1231 +#include "nsDragService.h"
1232
1233 static NS_DEFINE_IID(kCDragServiceCID, NS_DRAGSERVICE_CID);
1234
1235 @@ -101,9 +101,10 @@ STDMETHODIMP
1236 nsNativeDragSource::QueryContinueDrag(BOOL fEsc, DWORD grfKeyState)
1237 {
1238 nsCOMPtr<nsIDragService> dragService = do_GetService(kCDragServiceCID);
1239 - if (dragService) {
1240 + nsCOMPtr<nsPIDragService> dragServicePriv = do_QueryInterface(dragService);
1241 + if (dragServicePriv) {
1242 DWORD pos = ::GetMessagePos();
1243 - dragService->DragMoved(GET_X_LPARAM(pos), GET_Y_LPARAM(pos));
1244 + dragServicePriv->DragMoved(GET_X_LPARAM(pos), GET_Y_LPARAM(pos));
1245 }
1246
1247 if (fEsc) {
1248 diff --git a/widget/windows/nsNativeDragTarget.cpp b/widget/windows/nsNativeDragTarget.cpp
1249 index 3362ca6..a69817c 100644
1250 --- a/widget/windows/nsNativeDragTarget.cpp
1251 +++ b/widget/windows/nsNativeDragTarget.cpp
1252 @@ -205,7 +205,11 @@ nsNativeDragTarget::DispatchDragDropEvent(PRUint32 aEventType, POINTL aPT)
1253 event.isControl = IsKeyDown(NS_VK_CONTROL);
1254 event.isMeta = false;
1255 event.isAlt = IsKeyDown(NS_VK_ALT);
1256 - event.inputSource = static_cast<nsBaseDragService*>(mDragService)->GetInputSource();
1257 + event.inputSource = 0;
1258 + nsCOMPtr<nsPIDragService> dragServicePriv = do_QueryInterface(mDragService);
1259 + if (dragServicePriv) {
1260 + dragServicePriv->GetInputSource(&event.inputSource);
1261 + }
1262
1263 mWindow->DispatchEvent(&event, status);
1264 }
1265 @@ -292,9 +296,8 @@ nsNativeDragTarget::DragEnter(LPDATAOBJECT pIDataSource,
1266 // This cast is ok because in the constructor we created a
1267 // the actual implementation we wanted, so we know this is
1268 // a nsDragService. It should be a private interface, though.
1269 - nsDragService * winDragService =
1270 - static_cast<nsDragService *>(mDragService);
1271 - winDragService->SetIDataObject(pIDataSource);
1272 + nsCOMPtr<nsPIDragServiceWindows> winDragService = do_QueryInterface(mDragService);
1273 + winDragService->SetIDataObject((nsISupports*)pIDataSource);
1274
1275 // Now process the native drag state and then dispatch the event
1276 ProcessDrag(NS_DRAGDROP_ENTER, grfKeyState, ptl, pdwEffect);
1277 @@ -432,8 +435,8 @@ nsNativeDragTarget::Drop(LPDATAOBJECT pData,
1278 // This cast is ok because in the constructor we created a
1279 // the actual implementation we wanted, so we know this is
1280 // a nsDragService (but it should still be a private interface)
1281 - nsDragService* winDragService = static_cast<nsDragService*>(mDragService);
1282 - winDragService->SetIDataObject(pData);
1283 + nsCOMPtr<nsPIDragServiceWindows> winDragService = do_QueryInterface(mDragService);
1284 + winDragService->SetIDataObject((nsISupports*)pData);
1285
1286 // NOTE: ProcessDrag spins the event loop which may destroy arbitrary objects.
1287 // We use strong refs to prevent it from destroying these:
1288 @@ -457,11 +460,14 @@ nsNativeDragTarget::Drop(LPDATAOBJECT pData,
1289 // tell the drag service we're done with the session
1290 // Use GetMessagePos to get the position of the mouse at the last message
1291 // seen by the event loop. (Bug 489729)
1292 - DWORD pos = ::GetMessagePos();
1293 - POINT cpos;
1294 - cpos.x = GET_X_LPARAM(pos);
1295 - cpos.y = GET_Y_LPARAM(pos);
1296 - winDragService->SetDragEndPoint(nsIntPoint(cpos.x, cpos.y));
1297 + nsCOMPtr<nsPIDragService> dragServicePriv = do_QueryInterface(mDragService);
1298 + if (dragServicePriv) {
1299 + DWORD pos = ::GetMessagePos();
1300 + POINT cpos;
1301 + cpos.x = GET_X_LPARAM(pos);
1302 + cpos.y = GET_Y_LPARAM(pos);
1303 + dragServicePriv->SetDragEndPoint(cpos.x, cpos.y);
1304 + }
1305 serv->EndDragSession(true);
1306
1307 // release the ref that was taken in DragEnter
1308 diff --git a/widget/windows/nsPIDragServiceWindows.idl b/widget/windows/nsPIDragServiceWindows.idl
1309 new file mode 100644
1310 index 0000000..c8a46dd
1311 --- /dev/null
1312 +++ b/widget/windows/nsPIDragServiceWindows.idl
1313 @@ -0,0 +1,46 @@
1314 +/* ***** BEGIN LICENSE BLOCK *****
1315 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1316 + *
1317 + * The contents of this file are subject to the Mozilla Public License Version
1318 + * 1.1 (the "License"); you may not use this file except in compliance with
1319 + * the License. You may obtain a copy of the License at
1320 + * http://www.mozilla.org/MPL/
1321 + *
1322 + * Software distributed under the License is distributed on an "AS IS" basis,
1323 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1324 + * for the specific language governing rights and limitations under the
1325 + * License.
1326 + *
1327 + * The Original Code is mozilla.org code.
1328 + *
1329 + * The Initial Developer of the Original Code is
1330 + * The Mozilla Foundation.
1331 + * Portions created by the Initial Developer are Copyright (C) 2012
1332 + * the Initial Developer. All Rights Reserved.
1333 + *
1334 + * Contributor(s):
1335 + * Steven Michaud <smichaud@×××××.com>
1336 + *
1337 + * Alternatively, the contents of this file may be used under the terms of
1338 + * either the GNU General Public License Version 2 or later (the "GPL"), or
1339 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1340 + * in which case the provisions of the GPL or the LGPL are applicable instead
1341 + * of those above. If you wish to allow use of your version of this file only
1342 + * under the terms of either the GPL or the LGPL, and not to allow others to
1343 + * use your version of this file under the terms of the MPL, indicate your
1344 + * decision by deleting the provisions above and replace them with the notice
1345 + * and other provisions required by the GPL or the LGPL. If you do not delete
1346 + * the provisions above, a recipient may use your version of this file under
1347 + * the terms of any one of the MPL, the GPL or the LGPL.
1348 + *
1349 + * ***** END LICENSE BLOCK ***** */
1350 +
1351 +#include "nsISupports.idl"
1352 +
1353 +[scriptable, uuid(6FC2117D-5EB4-441A-9C12-62A783BEBC0C)]
1354 +interface nsPIDragServiceWindows : nsISupports
1355 +{
1356 + void setIDataObject(in nsISupports aDataObj);
1357 +
1358 + void setDroppedLocal();
1359 +};
1360 diff --git a/widget/xpwidgets/nsBaseDragService.cpp b/widget/xpwidgets/nsBaseDragService.cpp
1361 index 342a036..87e28f7 100644
1362 --- a/widget/xpwidgets/nsBaseDragService.cpp
1363 +++ b/widget/xpwidgets/nsBaseDragService.cpp
1364 @@ -88,7 +88,7 @@ nsBaseDragService::~nsBaseDragService()
1365 {
1366 }
1367
1368 -NS_IMPL_ISUPPORTS2(nsBaseDragService, nsIDragService, nsIDragSession)
1369 +NS_IMPL_ISUPPORTS3(nsBaseDragService, nsIDragService, nsPIDragService, nsIDragSession)
1370
1371 //---------------------------------------------------------
1372 NS_IMETHODIMP
1373 @@ -436,6 +436,20 @@ nsBaseDragService::DragMoved(PRInt32 aX, PRInt32 aY)
1374 return NS_OK;
1375 }
1376
1377 +NS_IMETHODIMP
1378 +nsBaseDragService::SetDragEndPoint(PRInt32 aX, PRInt32 aY)
1379 +{
1380 + mEndDragPoint = nsIntPoint(aX, aY);
1381 + return NS_OK;
1382 +}
1383 +
1384 +NS_IMETHODIMP
1385 +nsBaseDragService::GetInputSource(PRUint16* aInputSource)
1386 +{
1387 + *aInputSource = mInputSource;
1388 + return NS_OK;
1389 +}
1390 +
1391 static nsIPresShell*
1392 GetPresShellForContent(nsIDOMNode* aDOMNode)
1393 {
1394 diff --git a/widget/xpwidgets/nsBaseDragService.h b/widget/xpwidgets/nsBaseDragService.h
1395 index 290c0cb..2ceac2b 100644
1396 --- a/widget/xpwidgets/nsBaseDragService.h
1397 +++ b/widget/xpwidgets/nsBaseDragService.h
1398 @@ -39,6 +39,7 @@
1399 #define nsBaseDragService_h__
1400
1401 #include "nsIDragService.h"
1402 +#include "nsPIDragService.h"
1403 #include "nsIDragSession.h"
1404 #include "nsITransferable.h"
1405 #include "nsISupportsArray.h"
1406 @@ -64,6 +65,7 @@ class nsICanvasElementExternal;
1407 */
1408
1409 class nsBaseDragService : public nsIDragService,
1410 + public nsPIDragService,
1411 public nsIDragSession
1412 {
1413
1414 @@ -74,14 +76,11 @@ public:
1415 //nsISupports
1416 NS_DECL_ISUPPORTS
1417
1418 - //nsIDragSession and nsIDragService
1419 + //nsIDragSession, nsIDragService and nsPIDragService
1420 NS_DECL_NSIDRAGSERVICE
1421 + NS_DECL_NSPIDRAGSERVICE
1422 NS_DECL_NSIDRAGSESSION
1423
1424 - void SetDragEndPoint(nsIntPoint aEndDragPoint) { mEndDragPoint = aEndDragPoint; }
1425 -
1426 - PRUint16 GetInputSource() { return mInputSource; }
1427 -
1428 protected:
1429
1430 /**
1431 --
1432 1.7.5.4
1433
1434
1435
1436
1437 1.1 www-client/torbrowser/files/torbrowser-patches/0007-Disable-SSL-Session-ID-tracking.patch
1438
1439 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0007-Disable-SSL-Session-ID-tracking.patch?rev=1.1&view=markup
1440 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0007-Disable-SSL-Session-ID-tracking.patch?rev=1.1&content-type=text/plain
1441
1442 Index: 0007-Disable-SSL-Session-ID-tracking.patch
1443 ===================================================================
1444 From 3eebe3b7e2882de39e2c686a38e7084cccfa4c60 Mon Sep 17 00:00:00 2001
1445 From: Mike Perry <mikeperry-git@××××××.org>
1446 Date: Wed, 7 Dec 2011 19:36:38 -0800
1447 Subject: [PATCH 07/20] Disable SSL Session ID tracking.
1448
1449 We can't easily bind SSL Session ID tracking to url bar domain,
1450 so we have to disable them to satisfy
1451 https://www.torproject.org/projects/torbrowser/design/#identifier-linkability.
1452 ---
1453 security/nss/lib/ssl/sslsock.c | 2 +-
1454 1 files changed, 1 insertions(+), 1 deletions(-)
1455
1456 diff --git a/security/nss/lib/ssl/sslsock.c b/security/nss/lib/ssl/sslsock.c
1457 index 28e6210..fa48ecd 100644
1458 --- a/security/nss/lib/ssl/sslsock.c
1459 +++ b/security/nss/lib/ssl/sslsock.c
1460 @@ -173,7 +173,7 @@ static sslOptions ssl_defaults = {
1461 PR_FALSE, /* enableSSL2 */ /* now defaults to off in NSS 3.13 */
1462 PR_TRUE, /* enableSSL3 */
1463 PR_TRUE, /* enableTLS */ /* now defaults to on in NSS 3.0 */
1464 - PR_FALSE, /* noCache */
1465 + PR_TRUE, /* noCache */
1466 PR_FALSE, /* fdx */
1467 PR_FALSE, /* v2CompatibleHello */ /* now defaults to off in NSS 3.13 */
1468 PR_TRUE, /* detectRollBack */
1469 --
1470 1.7.5.4
1471
1472
1473
1474
1475 1.1 www-client/torbrowser/files/torbrowser-patches/0008-Provide-an-observer-event-to-close-persistent-connec.patch
1476
1477 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0008-Provide-an-observer-event-to-close-persistent-connec.patch?rev=1.1&view=markup
1478 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0008-Provide-an-observer-event-to-close-persistent-connec.patch?rev=1.1&content-type=text/plain
1479
1480 Index: 0008-Provide-an-observer-event-to-close-persistent-connec.patch
1481 ===================================================================
1482 From 9594d3f2df4f20308406deea30aaccd577587438 Mon Sep 17 00:00:00 2001
1483 From: Mike Perry <mikeperry-git@××××××××××.org>
1484 Date: Wed, 1 Feb 2012 15:53:28 -0800
1485 Subject: [PATCH 08/20] Provide an observer event to close persistent
1486 connections
1487
1488 We need to prevent linkability across "New Identity", which includes closing
1489 keep-alive connections.
1490 ---
1491 netwerk/protocol/http/nsHttpHandler.cpp | 7 +++++++
1492 1 files changed, 7 insertions(+), 0 deletions(-)
1493
1494 diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
1495 index dcdf729..672d436 100644
1496 --- a/netwerk/protocol/http/nsHttpHandler.cpp
1497 +++ b/netwerk/protocol/http/nsHttpHandler.cpp
1498 @@ -338,6 +338,7 @@ nsHttpHandler::Init()
1499 mObserverService->AddObserver(this, "net:clear-active-logins", true);
1500 mObserverService->AddObserver(this, NS_PRIVATE_BROWSING_SWITCH_TOPIC, true);
1501 mObserverService->AddObserver(this, "net:prune-dead-connections", true);
1502 + mObserverService->AddObserver(this, "net:prune-all-connections", PR_TRUE);
1503 }
1504
1505 return NS_OK;
1506 @@ -1587,6 +1588,12 @@ nsHttpHandler::Observe(nsISupports *subject,
1507 mConnMgr->PruneDeadConnections();
1508 }
1509 }
1510 + else if (strcmp(topic, "net:prune-all-connections") == 0) {
1511 + if (mConnMgr) {
1512 + mConnMgr->ClosePersistentConnections();
1513 + mConnMgr->PruneDeadConnections();
1514 + }
1515 + }
1516
1517 return NS_OK;
1518 }
1519 --
1520 1.7.5.4
1521
1522
1523
1524
1525 1.1 www-client/torbrowser/files/torbrowser-patches/0019-Fix-Firefox-13-build-process.patch
1526
1527 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0019-Fix-Firefox-13-build-process.patch?rev=1.1&view=markup
1528 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0019-Fix-Firefox-13-build-process.patch?rev=1.1&content-type=text/plain
1529
1530 Index: 0019-Fix-Firefox-13-build-process.patch
1531 ===================================================================
1532 From 41f44964edbee300c098d110be3f029ebb711081 Mon Sep 17 00:00:00 2001
1533 From: Mike Perry <mikeperry-git@××××××××××.org>
1534 Date: Fri, 8 Jun 2012 12:42:25 -0700
1535 Subject: [PATCH 19/20] Fix Firefox 13 build process.
1536
1537 Patch is from https://bugzilla.mozilla.org/show_bug.cgi?id=736961.
1538 ---
1539 config/rules.mk | 4 ++--
1540 js/src/config/rules.mk | 4 ++--
1541 js/xpconnect/src/Makefile.in | 10 +++++-----
1542 xpcom/idl-parser/Makefile.in | 2 +-
1543 xpcom/typelib/xpidl/Makefile.in | 4 ++--
1544 5 files changed, 12 insertions(+), 12 deletions(-)
1545
1546 diff --git a/config/rules.mk b/config/rules.mk
1547 index e6353e1..c65c1f3 100644
1548 --- a/config/rules.mk
1549 +++ b/config/rules.mk
1550 @@ -1479,7 +1479,7 @@ $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done
1551 $(PYTHON_PATH) \
1552 -I$(topsrcdir)/other-licenses/ply \
1553 -I$(topsrcdir)/xpcom/idl-parser \
1554 - $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
1555 + $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(DEPTH)/xpcom/idl-parser/cache $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
1556 @if test -n "$(findstring $*.h, $(EXPORTS))"; \
1557 then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi
1558
1559 @@ -1492,7 +1492,7 @@ $(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done
1560 -I$(topsrcdir)/other-licenses/ply \
1561 -I$(topsrcdir)/xpcom/idl-parser \
1562 -I$(topsrcdir)/xpcom/typelib/xpt/tools \
1563 - $(topsrcdir)/xpcom/idl-parser/typelib.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
1564 + $(topsrcdir)/xpcom/idl-parser/typelib.py --cachedir=$(DEPTH)/xpcom/idl-parser/cache $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
1565
1566 # no need to link together if XPIDLSRCS contains only XPIDL_MODULE
1567 ifneq ($(XPIDL_MODULE).idl,$(strip $(XPIDLSRCS)))
1568 diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk
1569 index e6353e1..c65c1f3 100644
1570 --- a/js/src/config/rules.mk
1571 +++ b/js/src/config/rules.mk
1572 @@ -1479,7 +1479,7 @@ $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done
1573 $(PYTHON_PATH) \
1574 -I$(topsrcdir)/other-licenses/ply \
1575 -I$(topsrcdir)/xpcom/idl-parser \
1576 - $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
1577 + $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(DEPTH)/xpcom/idl-parser/cache $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
1578 @if test -n "$(findstring $*.h, $(EXPORTS))"; \
1579 then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi
1580
1581 @@ -1492,7 +1492,7 @@ $(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done
1582 -I$(topsrcdir)/other-licenses/ply \
1583 -I$(topsrcdir)/xpcom/idl-parser \
1584 -I$(topsrcdir)/xpcom/typelib/xpt/tools \
1585 - $(topsrcdir)/xpcom/idl-parser/typelib.py --cachedir=$(DEPTH)/xpcom/idl-parser $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
1586 + $(topsrcdir)/xpcom/idl-parser/typelib.py --cachedir=$(DEPTH)/xpcom/idl-parser/cache $(XPIDL_FLAGS) $(_VPATH_SRCS) -d $(MDDEPDIR)/$(@F).pp -o $@
1587
1588 # no need to link together if XPIDLSRCS contains only XPIDL_MODULE
1589 ifneq ($(XPIDL_MODULE).idl,$(strip $(XPIDLSRCS)))
1590 diff --git a/js/xpconnect/src/Makefile.in b/js/xpconnect/src/Makefile.in
1591 index 7dc7812..a369bcd 100644
1592 --- a/js/xpconnect/src/Makefile.in
1593 +++ b/js/xpconnect/src/Makefile.in
1594 @@ -151,7 +151,7 @@ dom_quickstubs.cpp: $(srcdir)/dom_quickstubs.qsconf \
1595 -I$(topsrcdir)/xpcom/idl-parser \
1596 $(srcdir)/qsgen.py \
1597 --idlpath=$(DEPTH)/dist/idl \
1598 - --cachedir=$(DEPTH)/xpcom/idl-parser \
1599 + --cachedir=$(DEPTH)/xpcom/idl-parser/cache \
1600 --header-output dom_quickstubs.h \
1601 --stub-output dom_quickstubs.cpp \
1602 --makedepend-output $(MDDEPDIR)/dom_qsgen.pp \
1603 @@ -172,7 +172,7 @@ dombindings_gen.h: $(srcdir)/dombindings.conf \
1604 -I$(topsrcdir)/xpcom/idl-parser \
1605 $(srcdir)/dombindingsgen.py \
1606 --idlpath=$(DEPTH)/dist/idl \
1607 - --cachedir=$(DEPTH)/xpcom/idl-parser \
1608 + --cachedir=$(DEPTH)/xpcom/idl-parser/cache \
1609 --header-output dombindings_gen.h \
1610 $(srcdir)/dombindings.conf
1611
1612 @@ -189,7 +189,7 @@ dombindings_gen.cpp: $(srcdir)/dombindings.conf \
1613 -I$(topsrcdir)/xpcom/idl-parser \
1614 $(srcdir)/dombindingsgen.py \
1615 --idlpath=$(DEPTH)/dist/idl \
1616 - --cachedir=$(DEPTH)/xpcom/idl-parser \
1617 + --cachedir=$(DEPTH)/xpcom/idl-parser/cache \
1618 --stub-output dombindings_gen.cpp \
1619 --makedepend-output $(MDDEPDIR)/dombindingsgen.pp \
1620 $(srcdir)/dombindings.conf
1621 @@ -208,7 +208,7 @@ DictionaryHelpers.h: $(srcdir)/dictionary_helper_gen.conf \
1622 -I$(topsrcdir)/xpcom/idl-parser \
1623 $(srcdir)/dictionary_helper_gen.py \
1624 -I $(DEPTH)/dist/idl \
1625 - --cachedir=$(DEPTH)/xpcom/idl-parser \
1626 + --cachedir=$(DEPTH)/xpcom/idl-parser/cache \
1627 --header-output DictionaryHelpers.h \
1628 $(srcdir)/dictionary_helper_gen.conf
1629
1630 @@ -223,7 +223,7 @@ DictionaryHelpers.cpp: $(srcdir)/dictionary_helper_gen.conf \
1631 -I$(topsrcdir)/xpcom/idl-parser \
1632 $(srcdir)/dictionary_helper_gen.py \
1633 -I $(DEPTH)/dist/idl \
1634 - --cachedir=$(DEPTH)/xpcom/idl-parser \
1635 + --cachedir=$(DEPTH)/xpcom/idl-parser/cache \
1636 --header-output DictionaryHelpers.h \
1637 --stub-output DictionaryHelpers.cpp \
1638 --makedepend-output $(MDDEPDIR)/dictionary_helper_gen.pp \
1639 diff --git a/xpcom/idl-parser/Makefile.in b/xpcom/idl-parser/Makefile.in
1640 index f5ff178..97390c5 100644
1641 --- a/xpcom/idl-parser/Makefile.in
1642 +++ b/xpcom/idl-parser/Makefile.in
1643 @@ -61,7 +61,7 @@ export:: $(PARSER_SRCS) $(PLY_PROGS)
1644 $(PYTHON_PATH) \
1645 -I$(topsrcdir)/other-licenses/ply \
1646 -I$(topsrcdir)/xpcom/idl-parser \
1647 - $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=. --regen
1648 + $(topsrcdir)/xpcom/idl-parser/header.py --cachedir=$(DEPTH)/xpcom/idl-parser/cache --regen
1649
1650 check::
1651 $(PYTHON_PATH) \
1652 diff --git a/xpcom/typelib/xpidl/Makefile.in b/xpcom/typelib/xpidl/Makefile.in
1653 index bcae13a..4edda5d 100644
1654 --- a/xpcom/typelib/xpidl/Makefile.in
1655 +++ b/xpcom/typelib/xpidl/Makefile.in
1656 @@ -48,8 +48,8 @@ SDK_BINARY = \
1657 $(topsrcdir)/xpcom/idl-parser/xpidl.py \
1658 $(topsrcdir)/xpcom/idl-parser/header.py \
1659 $(topsrcdir)/xpcom/idl-parser/typelib.py \
1660 - $(DEPTH)/xpcom/idl-parser/xpidllex.py \
1661 - $(DEPTH)/xpcom/idl-parser/xpidlyacc.py \
1662 + $(DEPTH)/xpcom/idl-parser/cache/xpidllex.py \
1663 + $(DEPTH)/xpcom/idl-parser/cache/xpidlyacc.py \
1664 $(NULL)
1665
1666 ifndef MOZ_SYSTEM_PLY
1667 --
1668 1.7.5.4
1669
1670
1671
1672
1673 1.1 www-client/torbrowser/files/torbrowser-patches/0012-Add-DDG-and-StartPage-to-Omnibox.patch
1674
1675 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0012-Add-DDG-and-StartPage-to-Omnibox.patch?rev=1.1&view=markup
1676 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0012-Add-DDG-and-StartPage-to-Omnibox.patch?rev=1.1&content-type=text/plain
1677
1678 Index: 0012-Add-DDG-and-StartPage-to-Omnibox.patch
1679 ===================================================================
1680 From 59b8b663b93248db34ad741ccb9972ecb6814c1f Mon Sep 17 00:00:00 2001
1681 From: Mike Perry <mikeperry-git@××××××××××.org>
1682 Date: Wed, 25 Apr 2012 15:03:46 -0700
1683 Subject: [PATCH 12/20] Add DDG and StartPage to Omnibox.
1684
1685 You mean there are search engines that don't require captchas if you don't
1686 have a cookie? Holy crap. Get those in there now.
1687 ---
1688 browser/locales/en-US/searchplugins/duckduckgo.xml | 29 ++++++++++++++++++++
1689 browser/locales/en-US/searchplugins/list.txt | 2 +
1690 browser/locales/en-US/searchplugins/startpage.xml | 11 +++++++
1691 3 files changed, 42 insertions(+), 0 deletions(-)
1692 create mode 100644 browser/locales/en-US/searchplugins/duckduckgo.xml
1693 create mode 100644 browser/locales/en-US/searchplugins/startpage.xml
1694
1695 diff --git a/browser/locales/en-US/searchplugins/duckduckgo.xml b/browser/locales/en-US/searchplugins/duckduckgo.xml
1696 new file mode 100644
1697 index 0000000..4f00b4d
1698 --- /dev/null
1699 +++ b/browser/locales/en-US/searchplugins/duckduckgo.xml
1700 @@ -0,0 +1,29 @@
1701 +<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
1702 +<ShortName>DuckDuckGo</ShortName>
1703 +<Description>Duck Duck Go</Description>
1704 +<InputEncoding>UTF-8</InputEncoding>
1705 +<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAANcNAADXDQAAAAAA
1706 +AAAAAAAAAAAAAAAAAAAAAAAAAAAAJyDsJmlk8pf6+v3s/v7+++zr/fcnIOyzJyDsgCcg7CYAAAAA
1707 +AAAAAAAAAAAAAAAAAAAAAAAAAAAnIOwBJyDscCcg7PZttJ7/7Pfs//////++xO7/S5GA/ycg7P8n
1708 +IOz2JyDscCcg7AEAAAAAAAAAAAAAAAAnIOwBJyDstScg7P8nIOz/Y8p5/2fHZf9Yv0z/YcF2/1rB
1709 +Uv8nIOz/JyDs/ycg7P8nIOy1JyDsAQAAAAAAAAAAJyDscCcg7P8nIOz/JyDs/4jQoP/p9+n/////
1710 +/05X3v9LkYD/JyDs/ycg7P8nIOz/JyDs/ycg7HAAAAAAJyDsJicg7PYnIOz/JyDs/zUu7f/+/v//
1711 +//////////89N+7/JyDs/yUo7f8nIOz/JyDs/ycg7P8nIOz2JyDsJicg7IAnIOz/JyDs/ycg7P9h
1712 +XPH////////////t/P//GIr2/wfD+/8Gyfz/DKv5/yM57/8nIOz/JyDs/ycg7H8nIOyzJyDs/ycg
1713 +7P8nIOz/jov1////////////Otz9/w3G/P8cWfH/JSvt/ycg7P8nIOz/JyDs/ycg7P8nIOyzJyDs
1714 +5icg7P8nIOz/JyDs/7u5+f///////////27l/v8E0v3/BNL9/wTQ/f8Oofn/IT7v/ycg7P8nIOz/
1715 +JyDs5icg7OYnIOz/JyDs/ycg7P/p6P3/uWsC////////////5fr//6Po/f8Thfb/DKv5/w6f+f8n IOz/JyDs/ycg7OYnIOyzJyDs/ycg7P8nIOz/9/b+/////////////////7lrAv/V1Pv/JyDs/ycg
1716 +7P8nIOz/JyDs/ycg7P8nIOyzJyDsgCcg7P8nIOz/JyDs/8/N+///////////////////////iIX1
1717 +/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDsfycg7CYnIOz2JyDs/ycg7P9FP+7/q6n4/+7u/f/n5v3/
1718 +fXn0/yoj7P8nIOz/JyDs/ycg7P8nIOz/JyDs9icg7CYAAAAAJyDscCcg7P8nIOz/wsD6/+no/f/Y
1719 +1/z/eHTz/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs/ycg7HAAAAAAAAAAACcg7AEnIOy1JyDs/ycg
1720 +7P8nIOz/JyDs/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs/ycg7LUnIOwBAAAAAAAAAAAAAAAAJyDs
1721 +AScg7HAnIOz2JyDs/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs9icg7HAnIOwBAAAAAAAAAAAAAAAA
1722 +AAAAAAAAAAAAAAAAJyDsJicg7IAnIOyzJyDs5icg7OYnIOyzJyDsgCcg7CYAAAAAAAAAAAAAAAAA
1723 +AAAA+B8AAPAPAADAAwAAwAMAAIABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAACAAQAAwAMAAMAD
1724 +AADwDwAA+B8AAA==</Image>
1725 +<Url type="text/html" method="POST" template="https://duckduckgo.com/html/">
1726 + <Param name="q" value="{searchTerms}"/>
1727 +</Url>
1728 +<SearchForm>https://duckduckgo.com/html/</SearchForm>
1729 +</SearchPlugin>
1730 diff --git a/browser/locales/en-US/searchplugins/list.txt b/browser/locales/en-US/searchplugins/list.txt
1731 index 2a1141a..0466f4e 100644
1732 --- a/browser/locales/en-US/searchplugins/list.txt
1733 +++ b/browser/locales/en-US/searchplugins/list.txt
1734 @@ -1,7 +1,9 @@
1735 amazondotcom
1736 bing
1737 +duckduckgo
1738 eBay
1739 google
1740 +startpage
1741 twitter
1742 wikipedia
1743 yahoo
1744 diff --git a/browser/locales/en-US/searchplugins/startpage.xml b/browser/locales/en-US/searchplugins/startpage.xml
1745 new file mode 100644
1746 index 0000000..1a310b1
1747 --- /dev/null
1748 +++ b/browser/locales/en-US/searchplugins/startpage.xml
1749 @@ -0,0 +1,11 @@
1750 +<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
1751 +<ShortName>Startpage</ShortName>
1752 +<Description>Start Page</Description>
1753 +<InputEncoding>UTF-8</InputEncoding>
1754 +<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2jkj+9YtD/vWLQ/71i0P+9otD/vaLRP72i0T+9YtE/vWLRP72i0T+9otD/vaNRP72jUT+9otF/vaLRf73kkv+9Yc///WJP//1iT//9Yk///rAmf/94Mz/+sCa//aRTv/1iUH/9ok///aJP//2i0H/9otB//aJQv/2iUL/9otC//aNRP/2jUT/9o1E//aNRP/6wpv////////////96dr/95dQ//aNRP/2kET/9pBG//aQRv/2kEb/9pBG//aRR//3lEz/95BH//mueP/7xJ3/959g//efYf/4p23//vDm//3p2//3kEr/95FJ//aRSf/niFH/95FK//aRSv/2mE//95hS/vq4iP/////////////////81bj/95xZ//q4iP//////+bF+//eZT//njFT/PSqi/2xGjv/2mVD/951V/vedVv783cX///////vQrf/++PP///////748//+8uj///////m3gf/olFr/PSuj/w8Pt/9sSJD/951V//eeWf73oVv++8ul///////5sXf/+KRi//vRsf////////////3r3v/olF//Piyk/w8Pt/9sSJH/+J5Z//ieWv/3oV/++KZf/vihXP/97N7//vn0//zTs//6wJP/+bBy//q6iP/onW//Piyl/w8Pt/8fGbH/m2iB/+icY//4pGD/96hl/viqZf74pmD/+Kxr//3iy/////////n1//ivbP/onGj/Pi2m/w8Pt/8uJKz/fFeQ/x8Zsf8+Lqb/6J9r//ivbP74rm3++Klm//mpZv/5q2f/+bR9//m0e//poW7/Pi6n/w8Pt/9sTZj/+Ktp//ira/+rd4P/Dw+3/4xijv/5snH++
1755 LN1/vmvbf/5r23/+a5t//mvb//4r2//TTuk/w8Pt/8fGrL/6ah1//ivcP/4r3P/q3yI/w8Pt/+MZpP/+bN5/vm4ev75t3X/+bV1//m1df/5t3X/+Ld3/8qUhP98XZn/Hxqz/+mse//5t3f/2p+B/x8as/8PD7f/u4qK//m7fv76u4D++bl7//m3fP/5uXz/+bl8//m5fP/5t3z/+bl//x8as/9NPKf/fWCb/x8as/8PD7f/bVOh//q5f//6v4X++sGI/vm9g//5voX/+b6F//m9hf/6vYX/+r6F//nCh/+bepr/Hxu0/w8Pt/8PD7f/fWOh//q+hf/6wof/+saN/vrGjf75xIv/+ceL//nEi//5xIv/+sSL//rHi//6x43/+ceN/+m7kP+7lpj/6ruQ//rHkP/6x43/+seQ//rLlf76ypT++seR//rJkf/6yZH/+seR//rJkf/6yZH/+8mR//vJlP/7yZT/+smU//rJlP/6yZT/+8yV//rJlf/6zpn+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==</Image>
1756 +
1757 +<Url type="text/html" method="POST" template="https://startpage.com/do/search">
1758 + <Param name="q" value="{searchTerms}"/>
1759 +</Url>
1760 +<SearchForm>https://startpage.com/do/search/</SearchForm>
1761 +</SearchPlugin>
1762 --
1763 1.7.5.4
1764
1765
1766
1767
1768 1.1 www-client/torbrowser/files/torbrowser-patches/0016-Limit-the-number-of-fonts-per-document.patch
1769
1770 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0016-Limit-the-number-of-fonts-per-document.patch?rev=1.1&view=markup
1771 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0016-Limit-the-number-of-fonts-per-document.patch?rev=1.1&content-type=text/plain
1772
1773 Index: 0016-Limit-the-number-of-fonts-per-document.patch
1774 ===================================================================
1775 From 649b237e95315e9858cfb038f9f7f95199584cbd Mon Sep 17 00:00:00 2001
1776 From: Mike Perry <mikeperry-git@××××××××××.org>
1777 Date: Thu, 7 Jun 2012 15:09:59 -0700
1778 Subject: [PATCH 16/20] Limit the number of fonts per document.
1779
1780 We create two prefs:
1781 browser.display.max_font_count and browser.display.max_font_attempts.
1782 max_font_count sets a limit on the number of fonts actually used in the
1783 document, and max_font_attempts sets a limit on the total number of CSS
1784 queries that a document is allowed to perform.
1785
1786 Once either limit is reached, the browser behaves as if
1787 browser.display.use_document_fonts was set to 0 for subsequent font queries.
1788
1789 If a pref is not set or is negative, that limit does not apply.
1790
1791 This is done to address:
1792 https://www.torproject.org/projects/torbrowser/design/#fingerprinting-linkability
1793 ---
1794 layout/base/nsPresContext.cpp | 100 +++++++++++++++++++++++++++++++++++++++++
1795 layout/base/nsPresContext.h | 9 ++++
1796 layout/style/nsRuleNode.cpp | 13 ++++-
1797 3 files changed, 119 insertions(+), 3 deletions(-)
1798
1799 diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp
1800 index f3815fb..1ab210e 100644
1801 --- a/layout/base/nsPresContext.cpp
1802 +++ b/layout/base/nsPresContext.cpp
1803 @@ -97,6 +97,8 @@
1804 #include "FrameLayerBuilder.h"
1805 #include "nsDOMMediaQueryList.h"
1806 #include "nsSMILAnimationController.h"
1807 +#include "nsString.h"
1808 +#include "nsUnicharUtils.h"
1809
1810 #ifdef IBMBIDI
1811 #include "nsBidiPresUtils.h"
1812 @@ -772,6 +774,10 @@ nsPresContext::GetUserPreferences()
1813 // * use fonts?
1814 mUseDocumentFonts =
1815 Preferences::GetInt("browser.display.use_document_fonts") != 0;
1816 + mMaxFonts =
1817 + Preferences::GetInt("browser.display.max_font_count", -1);
1818 + mMaxFontAttempts =
1819 + Preferences::GetInt("browser.display.max_font_attempts", -1);
1820
1821 // * replace backslashes with Yen signs? (bug 245770)
1822 mEnableJapaneseTransform =
1823 @@ -1381,6 +1387,100 @@ nsPresContext::GetDefaultFont(PRUint8 aFontID, nsIAtom *aLanguage) const
1824 return font;
1825 }
1826
1827 +PRBool
1828 +nsPresContext::FontUseCountReached(const nsFont &font) {
1829 + if (mMaxFonts < 0) {
1830 + return PR_FALSE;
1831 + }
1832 +
1833 + for (PRUint32 i = 0; i < mFontsUsed.Length(); i++) {
1834 + if (mFontsUsed[i].name.Equals(font.name,
1835 + nsCaseInsensitiveStringComparator())
1836 + // XXX: Style is sometimes filled with garbage??
1837 + /*&& mFontsUsed[i].style == font.style*/) {
1838 + // seen it before: OK
1839 + return PR_FALSE;
1840 + }
1841 + }
1842 +
1843 + if (mFontsUsed.Length() >= mMaxFonts) {
1844 + return PR_TRUE;
1845 + }
1846 +
1847 + return PR_FALSE;
1848 +}
1849 +
1850 +PRBool
1851 +nsPresContext::FontAttemptCountReached(const nsFont &font) {
1852 + if (mMaxFontAttempts < 0) {
1853 + return PR_FALSE;
1854 + }
1855 +
1856 + for (PRUint32 i = 0; i < mFontsTried.Length(); i++) {
1857 + if (mFontsTried[i].name.Equals(font.name,
1858 + nsCaseInsensitiveStringComparator())
1859 + // XXX: Style is sometimes filled with garbage??
1860 + /*&& mFontsTried[i].style == font.style*/) {
1861 + // seen it before: OK
1862 + return PR_FALSE;
1863 + }
1864 + }
1865 +
1866 + if (mFontsTried.Length() >= mMaxFontAttempts) {
1867 + return PR_TRUE;
1868 + }
1869 +
1870 + return PR_FALSE;
1871 +}
1872 +
1873 +void
1874 +nsPresContext::AddFontUse(const nsFont &font) {
1875 + if (mMaxFonts < 0) {
1876 + return;
1877 + }
1878 +
1879 + for (PRUint32 i = 0; i < mFontsUsed.Length(); i++) {
1880 + if (mFontsUsed[i].name.Equals(font.name,
1881 + nsCaseInsensitiveStringComparator())
1882 + // XXX: Style is sometimes filled with garbage??
1883 + /*&& mFontsUsed[i].style == font.style*/) {
1884 + // seen it before: OK
1885 + return;
1886 + }
1887 + }
1888 +
1889 + if (mFontsUsed.Length() >= mMaxFonts) {
1890 + return;
1891 + }
1892 +
1893 + mFontsUsed.AppendElement(font);
1894 + return;
1895 +}
1896 +
1897 +void
1898 +nsPresContext::AddFontAttempt(const nsFont &font) {
1899 + if (mMaxFontAttempts < 0) {
1900 + return;
1901 + }
1902 +
1903 + for (PRUint32 i = 0; i < mFontsTried.Length(); i++) {
1904 + if (mFontsTried[i].name.Equals(font.name,
1905 + nsCaseInsensitiveStringComparator())
1906 + // XXX: Style is sometimes filled with garbage??
1907 + /*&& mFontsTried[i].style == font.style*/) {
1908 + // seen it before: OK
1909 + return;
1910 + }
1911 + }
1912 +
1913 + if (mFontsTried.Length() >= mMaxFontAttempts) {
1914 + return;
1915 + }
1916 +
1917 + mFontsTried.AppendElement(font);
1918 + return;
1919 +}
1920 +
1921 void
1922 nsPresContext::SetFullZoom(float aZoom)
1923 {
1924 diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h
1925 index e367c5f..3d979f1 100644
1926 --- a/layout/base/nsPresContext.h
1927 +++ b/layout/base/nsPresContext.h
1928 @@ -535,6 +535,13 @@ public:
1929 }
1930 }
1931
1932 + nsTArray<nsFont> mFontsUsed; // currently for font-count limiting only
1933 + nsTArray<nsFont> mFontsTried; // currently for font-count limiting only
1934 + void AddFontUse(const nsFont &font);
1935 + void AddFontAttempt(const nsFont &font);
1936 + PRBool FontUseCountReached(const nsFont &font);
1937 + PRBool FontAttemptCountReached(const nsFont &font);
1938 +
1939 /**
1940 * Get the minimum font size for the specified language. If aLanguage
1941 * is nsnull, then the document's language is used.
1942 @@ -1188,6 +1195,8 @@ protected:
1943 PRUint32 mInterruptChecksToSkip;
1944
1945 mozilla::TimeStamp mReflowStartTime;
1946 + PRInt32 mMaxFontAttempts;
1947 + PRInt32 mMaxFonts;
1948
1949 unsigned mHasPendingInterrupt : 1;
1950 unsigned mInterruptsEnabled : 1;
1951 diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp
1952 index 4b134b2..82b1dd7 100644
1953 --- a/layout/style/nsRuleNode.cpp
1954 +++ b/layout/style/nsRuleNode.cpp
1955 @@ -3102,14 +3102,15 @@ nsRuleNode::ComputeFontData(void* aStartStruct,
1956
1957 bool useDocumentFonts =
1958 mPresContext->GetCachedBoolPref(kPresContext_UseDocumentFonts);
1959 + bool isXUL = PR_FALSE;
1960
1961 // See if we are in the chrome
1962 // We only need to know this to determine if we have to use the
1963 // document fonts (overriding the useDocumentFonts flag).
1964 - if (!useDocumentFonts && mPresContext->IsChrome()) {
1965 + if (mPresContext->IsChrome()) {
1966 // if we are not using document fonts, but this is a XUL document,
1967 // then we use the document fonts anyway
1968 - useDocumentFonts = true;
1969 + isXUL = true;
1970 }
1971
1972 // Figure out if we are a generic font
1973 @@ -3123,9 +3124,13 @@ nsRuleNode::ComputeFontData(void* aStartStruct,
1974 // generic?
1975 nsFont::GetGenericID(font->mFont.name, &generic);
1976
1977 + mPresContext->AddFontAttempt(font->mFont);
1978 +
1979 // If we aren't allowed to use document fonts, then we are only entitled
1980 // to use the user's default variable-width font and fixed-width font
1981 - if (!useDocumentFonts) {
1982 + if (!isXUL && (!useDocumentFonts ||
1983 + mPresContext->FontAttemptCountReached(font->mFont) ||
1984 + mPresContext->FontUseCountReached(font->mFont))) {
1985 // Extract the generic from the specified font family...
1986 nsAutoString genericName;
1987 if (!font->mFont.EnumerateFamilies(ExtractGeneric, &genericName)) {
1988 @@ -3161,6 +3166,8 @@ nsRuleNode::ComputeFontData(void* aStartStruct,
1989 font);
1990 }
1991
1992 + if (font->mGenericID == kGenericFont_NONE)
1993 + mPresContext->AddFontUse(font->mFont);
1994 COMPUTE_END_INHERITED(Font, font)
1995 }
1996
1997 --
1998 1.7.5.4
1999
2000
2001
2002
2003 1.1 www-client/torbrowser/files/torbrowser-patches/0014-Prevent-WebSocket-DNS-leak.patch
2004
2005 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0014-Prevent-WebSocket-DNS-leak.patch?rev=1.1&view=markup
2006 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0014-Prevent-WebSocket-DNS-leak.patch?rev=1.1&content-type=text/plain
2007
2008 Index: 0014-Prevent-WebSocket-DNS-leak.patch
2009 ===================================================================
2010 From 0607517f87c2a0060f4f1e437f0ac37a889047a9 Mon Sep 17 00:00:00 2001
2011 From: Mike Perry <mikeperry-git@××××××××××.org>
2012 Date: Wed, 2 May 2012 17:44:39 -0700
2013 Subject: [PATCH 14/20] Prevent WebSocket DNS leak.
2014
2015 This is due to an improper implementation of the WebSocket spec by Mozilla.
2016
2017 "There MUST be no more than one connection in a CONNECTING state. If multiple
2018 connections to the same IP address are attempted simultaneously, the client
2019 MUST serialize them so that there is no more than one connection at a time
2020 running through the following steps.
2021
2022 If the client cannot determine the IP address of the remote host (for
2023 example, because all communication is being done through a proxy server that
2024 performs DNS queries itself), then the client MUST assume for the purposes of
2025 this step that each host name refers to a distinct remote host,"
2026
2027 https://tools.ietf.org/html/rfc6455#page-15
2028
2029 They implmented the first paragraph, but not the second...
2030
2031 While we're at it, we also prevent the DNS service from being used to look up
2032 anything other than IP addresses if socks_remote_dns is set to true, so this
2033 bug can't turn up in other components or due to 3rd party addons.
2034 ---
2035 netwerk/dns/nsDNSService2.cpp | 24 ++++++++++++++++++++++-
2036 netwerk/dns/nsDNSService2.h | 1 +
2037 netwerk/protocol/websocket/WebSocketChannel.cpp | 8 +++++-
2038 3 files changed, 30 insertions(+), 3 deletions(-)
2039
2040 diff --git a/netwerk/dns/nsDNSService2.cpp b/netwerk/dns/nsDNSService2.cpp
2041 index 7458729..40fbaba 100644
2042 --- a/netwerk/dns/nsDNSService2.cpp
2043 +++ b/netwerk/dns/nsDNSService2.cpp
2044 @@ -403,6 +403,7 @@ nsDNSService::Init()
2045 bool enableIDN = true;
2046 bool disableIPv6 = false;
2047 bool disablePrefetch = false;
2048 + bool disableDNS = false;
2049 int proxyType = nsIProtocolProxyService::PROXYCONFIG_DIRECT;
2050
2051 nsAdoptingCString ipv4OnlyDomains;
2052 @@ -426,6 +427,10 @@ nsDNSService::Init()
2053
2054 // If a manual proxy is in use, disable prefetch implicitly
2055 prefs->GetIntPref("network.proxy.type", &proxyType);
2056 +
2057 + // If the user wants remote DNS, we should fail any lookups that still
2058 + // make it here.
2059 + prefs->GetBoolPref("network.proxy.socks_remote_dns", &disableDNS);
2060 }
2061
2062 if (mFirstTime) {
2063 @@ -443,7 +448,7 @@ nsDNSService::Init()
2064
2065 // Monitor these to see if there is a change in proxy configuration
2066 // If a manual proxy is in use, disable prefetch implicitly
2067 - prefs->AddObserver("network.proxy.type", this, false);
2068 + prefs->AddObserver("network.proxy.", this, false);
2069 }
2070 }
2071
2072 @@ -472,6 +477,7 @@ nsDNSService::Init()
2073 mIDN = idn;
2074 mIPv4OnlyDomains = ipv4OnlyDomains; // exchanges buffer ownership
2075 mDisableIPv6 = disableIPv6;
2076 + mDisableDNS = disableDNS;
2077
2078 // Disable prefetching either by explicit preference or if a manual proxy is configured
2079 mDisablePrefetch = disablePrefetch || (proxyType == nsIProtocolProxyService::PROXYCONFIG_MANUAL);
2080 @@ -583,6 +589,14 @@ nsDNSService::AsyncResolve(const nsACString &hostname,
2081 if (mDisablePrefetch && (flags & RESOLVE_SPECULATE))
2082 return NS_ERROR_DNS_LOOKUP_QUEUE_FULL;
2083
2084 + PRNetAddr tempAddr;
2085 + if (mDisableDNS) {
2086 + // Allow IP lookups through, but nothing else.
2087 + if (PR_StringToNetAddr(hostname.BeginReading(), &tempAddr) != PR_SUCCESS) {
2088 + return NS_ERROR_UNKNOWN_PROXY_HOST; // XXX: NS_ERROR_NOT_IMPLEMENTED?
2089 + }
2090 + }
2091 +
2092 res = mResolver;
2093 idn = mIDN;
2094 }
2095 @@ -669,6 +683,14 @@ nsDNSService::Resolve(const nsACString &hostname,
2096 MutexAutoLock lock(mLock);
2097 res = mResolver;
2098 idn = mIDN;
2099 +
2100 + PRNetAddr tempAddr;
2101 + if (mDisableDNS) {
2102 + // Allow IP lookups through, but nothing else.
2103 + if (PR_StringToNetAddr(hostname.BeginReading(), &tempAddr) != PR_SUCCESS) {
2104 + return NS_ERROR_UNKNOWN_PROXY_HOST; // XXX: NS_ERROR_NOT_IMPLEMENTED?
2105 + }
2106 + }
2107 }
2108 NS_ENSURE_TRUE(res, NS_ERROR_OFFLINE);
2109
2110 diff --git a/netwerk/dns/nsDNSService2.h b/netwerk/dns/nsDNSService2.h
2111 index 1749b41..3ec8eba 100644
2112 --- a/netwerk/dns/nsDNSService2.h
2113 +++ b/netwerk/dns/nsDNSService2.h
2114 @@ -70,4 +70,5 @@ private:
2115 bool mDisableIPv6;
2116 bool mDisablePrefetch;
2117 bool mFirstTime;
2118 + bool mDisableDNS;
2119 };
2120 diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp
2121 index 3578866..b1aaec2 100644
2122 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp
2123 +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
2124 @@ -1884,8 +1884,12 @@ WebSocketChannel::ApplyForAdmission()
2125 LOG(("WebSocketChannel::ApplyForAdmission: checking for concurrent open\n"));
2126 nsCOMPtr<nsIThread> mainThread;
2127 NS_GetMainThread(getter_AddRefs(mainThread));
2128 - dns->AsyncResolve(hostName, 0, this, mainThread, getter_AddRefs(mDNSRequest));
2129 - NS_ENSURE_SUCCESS(rv, rv);
2130 + rv = dns->AsyncResolve(hostName, 0, this, mainThread, getter_AddRefs(mDNSRequest));
2131 + if (NS_FAILED(rv)) {
2132 + // Fall back to hostname on dispatch failure
2133 + mDNSRequest = nsnull;
2134 + OnLookupComplete(nsnull, nsnull, rv);
2135 + }
2136
2137 return NS_OK;
2138 }
2139 --
2140 1.7.5.4
2141
2142
2143
2144
2145 1.1 www-client/torbrowser/files/torbrowser-patches/0013-Make-nsICacheService.EvictEntries-synchronous.patch
2146
2147 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0013-Make-nsICacheService.EvictEntries-synchronous.patch?rev=1.1&view=markup
2148 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/files/torbrowser-patches/0013-Make-nsICacheService.EvictEntries-synchronous.patch?rev=1.1&content-type=text/plain
2149
2150 Index: 0013-Make-nsICacheService.EvictEntries-synchronous.patch
2151 ===================================================================
2152 From 3b6137594c9f25725b3dd0fd46cfc8c86d6a772e Mon Sep 17 00:00:00 2001
2153 From: Mike Perry <mikeperry-git@××××××××××.org>
2154 Date: Tue, 1 May 2012 15:02:03 -0700
2155 Subject: [PATCH 13/20] Make nsICacheService.EvictEntries synchronous
2156
2157 This fixes a race condition that allows cache-based EverCookies to persist for
2158 a brief time (on the order of minutes?) after cache clearing/"New Identity".
2159
2160 https://trac.torproject.org/projects/tor/ticket/5715
2161 ---
2162 netwerk/cache/nsCacheService.cpp | 15 +++++++++++++--
2163 1 files changed, 13 insertions(+), 2 deletions(-)
2164
2165 diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp
2166 index 8c85b68..d43f121 100644
2167 --- a/netwerk/cache/nsCacheService.cpp
2168 +++ b/netwerk/cache/nsCacheService.cpp
2169 @@ -1414,10 +1414,21 @@ NS_IMETHODIMP nsCacheService::VisitEntries(nsICacheVisitor *visitor)
2170 return NS_OK;
2171 }
2172
2173 -
2174 NS_IMETHODIMP nsCacheService::EvictEntries(nsCacheStoragePolicy storagePolicy)
2175 {
2176 - return EvictEntriesForClient(nsnull, storagePolicy);
2177 + NS_IMETHODIMP r;
2178 + r = EvictEntriesForClient(nsnull, storagePolicy);
2179 +
2180 + // XXX: Bloody hack until we get this notifier in FF14.0:
2181 + // https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsICacheListener#onCacheEntryDoomed%28%29
2182 + if (storagePolicy == nsICache::STORE_ANYWHERE &&
2183 + NS_IsMainThread() && gService && gService->mInitialized) {
2184 + nsCacheServiceAutoLock lock;
2185 + gService->DoomActiveEntries();
2186 + gService->ClearDoomList();
2187 + (void) SyncWithCacheIOThread();
2188 + }
2189 + return r;
2190 }
2191
2192 NS_IMETHODIMP nsCacheService::GetCacheIOTarget(nsIEventTarget * *aCacheIOTarget)
2193 --
2194 1.7.5.4