~ubuntu-branches/ubuntu/lucid/firefox/lucid-updates

« back to all changes in this revision

Viewing changes to debian/patches/avoid-dbus-roundtrip-for-httpchannel.patch

  • Committer: Package Import Robot
  • Author(s): Chris Coulson, Chris Coulson, Jamie Strandboge
  • Date: 2012-06-01 18:33:36 UTC
  • mfrom: (1.1.43)
  • Revision ID: package-import@ubuntu.com-20120601183336-bamdjl485ei371rz
Tags: 13.0+build1-0ubuntu0.10.04.1
* New upstream stable release (FIREFOX_13_0_BUILD1)
  - see LP: #1007495 for USN information

[ Chris Coulson <chris.coulson@canonical.com> ]
* Refresh build-depends:
  - Bump minimum GTK version to 2.14 as we build with GIO support
  - Add minimum requirement for glib (2.18)
  - Drop libidl-dev, this doesn't appear to be needed now
  - Bump minimum NSPR version to 4.9.0 for --enable-system-nspr builds
  - Bump minimum sqlite version to 3.7.10 for --enable-system-sqlite
    builds
  - Bump minimum NSS version to 3.13.2 for --enable-system-nss builds
* Refresh patches:
  - update debian/patches/ubuntu-ua-string-changes.patch
  - update debian/patches/ubuntu-codes-google.patch
  - update debian/patches/use-new-yasm-in-lucid.patch
  - update debian/patches/firefox-kde.patch
  - update debian/patches/mozilla-kde.patch
  - update debian/patches/dont-include-hyphenation-patterns.patch
* Clean up the file exclude list and add comments for excluded files
  - update debian/build/create-tarball.py
* Make it easy to run Firefox in valgrind for builds that are compiled
  with explicit valgrind support
  - update debian/firefox.sh.in
* Don't build with gnomevfs anymore
  - update debian/firefox-gnome-support.install.in
  - update debian/config/mozconfig.in
  - update debian/control.in
  - update debian/rules
* Bump debhelper compat to 7
  - update debian/apport/blacklist.in
  - update debian/apport/source_firefox.py.in
  - update debian/compat
  - update debian/config/mozconfig.in
  - update debian/control.in
  - update debian/firefox-dev.install.in
  - update debian/firefox-dev.links.in
  - update debian/firefox-gnome-support.install.in
  - update debian/firefox.dirs.in
  - update debian/firefox.install.in
  - update debian/firefox.links.in
  - update debian/firefox.postinst.in
  - update debian/firefox.preinst.in
  - update debian/firefox.sh.in
  - update debian/pkgconfig/libxul.pc.in
  - update debian/pkgconfig/mozilla-nspr.pc.in
  - update debian/pkgconfig/mozilla-plugin.pc.in
  - update debian/rules
  - update debian/usr.bin.firefox.apparmor.10.04
  - update debian/usr.bin.firefox.apparmor.9.10
* Override 2 embedded-library lintian errors
  - update debian/firefox.lintian-overrides.in
* Drop debian/patches/distro-locale-searchplugins after landing of
  bmo: #515232
* Don't hardcode general.useragent.locale to en-US, now that it's used
  for searchplugin localization. This means we can drop this pref from
  ubufox
  - add debian/patches/dont-override-general-useragent-locale.patch
  - update debian/patches/series
* Drop patches fixed upstream
  - remove debian/patches/no-sps-profiler-on-unsupported-archs.patch
  - remove debian/patches/avoid-dbus-roundtrip-for-httpchannel.patch
  - update debian/patches/series
* Apport hook improvements:
  - Add support for reporting preference defaults that are set by extensions
  - When reporting preferences, record the source of each preference
  - Report plugin packages for plugins that are installed with the
    package manager
  - Add some addon manager related prefs to the whitelist
  - Display additional metadata in the extensions report
  - Take "default-to-compatible" in to account when determining whether
    the user is running incompatible addons
  - Attach submitted crash ID's to bug reports
  - Report if files in the profile folder have broken permissions
* Update compare-locales to 0.9.5
* Fix make-makefile test failure when the build directory contains
  perl regexp control characters
  - add debian/patches/make-makefile-test-fix.patch
  - update debian/patches/series
* Fix for NSS libs not being signed, breaking FIPS
  - update debian/rules

[ Jamie Strandboge <jamie@ubuntu.com> ]
* adjust apparmor profile to deny reads to @{PROC}/[0-9]*/net/dev. Patch 
  thanks to James Troup (LP: #955066)
* adjust apparmor profile to deny reads to @{PROC}/[0-9]*/net/wireless.
  Patch thanks to James Troup (LP: #974141)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# HG changeset patch
2
 
# Parent 9bde0d25d76e4ef301668a8016f6edcba1662826
3
 
# User Chris Coulson <chris.coulson@canonical.com>
4
 
Bug 716467 - Don't call g_settings_new each time we look up system proxy settings
5
 
 
6
 
diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
7
 
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
8
 
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
9
 
@@ -45,74 +45,78 @@
10
 
 #include "nsReadableUtils.h"
11
 
 #include "nsArrayUtils.h"
12
 
 #include "prnetdb.h"
13
 
 #include "prenv.h"
14
 
 #include "nsPrintfCString.h"
15
 
 #include "nsNetUtil.h"
16
 
 #include "nsISupportsPrimitives.h"
17
 
 #include "nsIGSettingsService.h"
18
 
+#include "nsInterfaceHashtable.h"
19
 
 
20
 
 class nsUnixSystemProxySettings : public nsISystemProxySettings {
21
 
 public:
22
 
   NS_DECL_ISUPPORTS
23
 
   NS_DECL_NSISYSTEMPROXYSETTINGS
24
 
 
25
 
   nsUnixSystemProxySettings() {}
26
 
   nsresult Init();
27
 
 
28
 
 private:
29
 
   ~nsUnixSystemProxySettings() {}
30
 
   
31
 
   nsCOMPtr<nsIGConfService> mGConf;
32
 
   nsCOMPtr<nsIGSettingsService> mGSettings;
33
 
+  nsCOMPtr<nsIGSettingsCollection> mProxySettings;
34
 
+  nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection> mSchemeProxySettings;
35
 
   bool IsProxyMode(const char* aMode);
36
 
   nsresult SetProxyResultFromGConf(const char* aKeyBase, const char* aType, nsACString& aResult);
37
 
   nsresult GetProxyFromGConf(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult);
38
 
   nsresult GetProxyFromGSettings(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult);
39
 
   nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, nsACString& aResult);
40
 
 };
41
 
 
42
 
 NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings)
43
 
 
44
 
 nsresult
45
 
 nsUnixSystemProxySettings::Init()
46
 
 {
47
 
+  mSchemeProxySettings.Init(5);
48
 
   mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
49
 
   mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
50
 
+  if (mGSettings) {
51
 
+    mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"),
52
 
+                                       getter_AddRefs(mProxySettings));
53
 
+  }
54
 
+
55
 
   return NS_OK;
56
 
 }
57
 
 
58
 
 bool
59
 
 nsUnixSystemProxySettings::IsProxyMode(const char* aMode)
60
 
 {
61
 
   nsCAutoString mode;
62
 
   return NS_SUCCEEDED(mGConf->GetString(NS_LITERAL_CSTRING("/system/proxy/mode"), mode)) &&
63
 
          mode.EqualsASCII(aMode);
64
 
 }
65
 
 
66
 
 nsresult
67
 
 nsUnixSystemProxySettings::GetPACURI(nsACString& aResult)
68
 
 {
69
 
-  if (mGSettings) {
70
 
-    nsCOMPtr<nsIGSettingsCollection> proxy_settings;
71
 
-    mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"), 
72
 
-                                       getter_AddRefs(proxy_settings));
73
 
-    if (proxy_settings) {
74
 
-      nsCString proxyMode;
75
 
-      // Check if mode is auto
76
 
-      nsresult rv = proxy_settings->GetString(NS_LITERAL_CSTRING("mode"), proxyMode);
77
 
-      if (rv == NS_OK && proxyMode.Equals("auto")) {
78
 
-        return proxy_settings->GetString(NS_LITERAL_CSTRING("autoconfig-url"), aResult);
79
 
-      }
80
 
-      /* The org.gnome.system.proxy schema has been found, but auto mode is not set.
81
 
-       * Don't try the GConf and return empty string. */
82
 
-      aResult.Truncate();
83
 
-      return NS_OK;
84
 
+  if (mProxySettings) {
85
 
+    nsCString proxyMode;
86
 
+    // Check if mode is auto
87
 
+    nsresult rv = mProxySettings->GetString(NS_LITERAL_CSTRING("mode"), proxyMode);
88
 
+    if (rv == NS_OK && proxyMode.Equals("auto")) {
89
 
+      return mProxySettings->GetString(NS_LITERAL_CSTRING("autoconfig-url"), aResult);
90
 
     }
91
 
+    /* The org.gnome.system.proxy schema has been found, but auto mode is not set.
92
 
+     * Don't try the GConf and return empty string. */
93
 
+    aResult.Truncate();
94
 
+    return NS_OK;
95
 
   }
96
 
 
97
 
   if (mGConf && IsProxyMode("auto")) {
98
 
     return mGConf->GetString(NS_LITERAL_CSTRING("/system/proxy/autoconfig_url"),
99
 
                              aResult);
100
 
   }
101
 
   // Return an empty string when auto mode is not set.
102
 
   aResult.Truncate();
103
 
@@ -261,20 +265,26 @@ nsUnixSystemProxySettings::SetProxyResul
104
 
   SetProxyResult(aType, host, port, aResult);
105
 
   return NS_OK;
106
 
 }
107
 
 
108
 
 nsresult
109
 
 nsUnixSystemProxySettings::SetProxyResultFromGSettings(const char* aKeyBase, const char* aType,
110
 
                                                        nsACString& aResult)
111
 
 {
112
 
-  nsCOMPtr<nsIGSettingsCollection> proxy_settings;
113
 
-  nsresult rv = mGSettings->GetCollectionForSchema(nsDependentCString(aKeyBase),
114
 
-                                                   getter_AddRefs(proxy_settings));
115
 
-  NS_ENSURE_SUCCESS(rv, rv);
116
 
+  nsDependentCString key(aKeyBase);
117
 
+
118
 
+  nsCOMPtr<nsIGSettingsCollection> proxy_settings = mSchemeProxySettings.Get(key);
119
 
+  nsresult rv;
120
 
+  if (!proxy_settings) {
121
 
+    rv = mGSettings->GetCollectionForSchema(key, getter_AddRefs(proxy_settings));
122
 
+    NS_ENSURE_SUCCESS(rv, rv);
123
 
+
124
 
+    mSchemeProxySettings.Put(key, proxy_settings);
125
 
+  }
126
 
 
127
 
   nsCAutoString host;
128
 
   rv = proxy_settings->GetString(NS_LITERAL_CSTRING("host"), host);
129
 
   NS_ENSURE_SUCCESS(rv, rv);
130
 
   if (host.IsEmpty())
131
 
     return NS_ERROR_FAILURE;
132
 
   
133
 
   PRInt32 port;
134
 
@@ -446,35 +456,27 @@ nsUnixSystemProxySettings::GetProxyFromG
135
 
 }
136
 
 
137
 
 nsresult
138
 
 nsUnixSystemProxySettings::GetProxyFromGSettings(const nsACString& aScheme,
139
 
                                                  const nsACString& aHost,
140
 
                                                  PRInt32 aPort,
141
 
                                                  nsACString& aResult)
142
 
 {
143
 
-  nsCOMPtr<nsIGSettingsCollection> proxy_settings;
144
 
-  nsresult rv;
145
 
-
146
 
-  rv = mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"),
147
 
-                                          getter_AddRefs(proxy_settings));
148
 
-  if (NS_FAILED(rv))
149
 
-    return rv;
150
 
-
151
 
   nsCString proxyMode; 
152
 
-  rv = proxy_settings->GetString(NS_LITERAL_CSTRING("mode"), proxyMode);
153
 
+  nsresult rv = mProxySettings->GetString(NS_LITERAL_CSTRING("mode"), proxyMode);
154
 
   NS_ENSURE_SUCCESS(rv, rv);
155
 
   
156
 
   if (!proxyMode.Equals("manual")) {
157
 
     aResult.AppendLiteral("DIRECT");
158
 
     return NS_OK;
159
 
   }
160
 
 
161
 
   nsCOMPtr<nsIArray> ignoreList;
162
 
-  if (NS_SUCCEEDED(proxy_settings->GetStringList(NS_LITERAL_CSTRING("ignore-hosts"),
163
 
+  if (NS_SUCCEEDED(mProxySettings->GetStringList(NS_LITERAL_CSTRING("ignore-hosts"),
164
 
                                                  getter_AddRefs(ignoreList))) && ignoreList) {
165
 
     PRUint32 len = 0;
166
 
     ignoreList->GetLength(&len);
167
 
     for (PRUint32 i = 0; i < len; ++i) {
168
 
       nsCOMPtr<nsISupportsCString> str = do_QueryElementAt(ignoreList, i);
169
 
       if (str) {
170
 
         nsCString s;
171
 
         if (NS_SUCCEEDED(str->GetData(s)) && !s.IsEmpty()) {
172
 
@@ -521,17 +523,17 @@ nsUnixSystemProxySettings::GetProxyForUR
173
 
   nsCAutoString host;
174
 
   rv = aURI->GetHost(host);
175
 
   NS_ENSURE_SUCCESS(rv, rv);
176
 
 
177
 
   PRInt32 port;
178
 
   rv = aURI->GetPort(&port);
179
 
   NS_ENSURE_SUCCESS(rv, rv);
180
 
 
181
 
-  if (mGSettings) {
182
 
+  if (mProxySettings) {
183
 
     rv = GetProxyFromGSettings(scheme, host, port, aResult);
184
 
     if (rv == NS_OK)
185
 
       return rv;
186
 
   }
187
 
   if (mGConf)
188
 
     return GetProxyFromGConf(scheme, host, port, aResult);
189
 
 
190
 
   return GetProxyFromEnvironment(scheme, host, port, aResult);