~mozillateam/firefox/firefox.utopic

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Description: Add "Ubuntu" to the platform part of the UA string
Author: Chris Coulson <chris.coulson@canonical.com>
Forwarded: not-needed

Index: firefox-trunk-39.0~a1~hg20150319r234403/netwerk/protocol/http/nsHttpHandler.cpp
===================================================================
--- firefox-trunk-39.0~a1~hg20150319r234403.orig/netwerk/protocol/http/nsHttpHandler.cpp	2015-03-19 22:06:15.726198019 +0000
+++ firefox-trunk-39.0~a1~hg20150319r234403/netwerk/protocol/http/nsHttpHandler.cpp	2015-03-19 22:12:18.075823254 +0000
@@ -170,6 +170,9 @@
     , mLegacyAppName("Mozilla")
     , mLegacyAppVersion("5.0")
     , mProduct("Gecko")
+#ifdef MOZ_UA_VENDOR
+    , mVendor(MOZ_UA_VENDOR)
+#endif
     , mCompatFirefoxEnabled(false)
     , mUserAgentIsDirty(true)
     , mUseCache(true)
@@ -333,6 +336,9 @@
     LOG(("> misc = %s\n", mMisc.get()));
     LOG(("> product = %s\n", mProduct.get()));
     LOG(("> product-sub = %s\n", mProductSub.get()));
+#ifdef MOZ_UA_VENDOR
+    LOG(("> vendor = %s\n", mVendor.get()));
+#endif
     LOG(("> app-name = %s\n", mAppName.get()));
     LOG(("> app-version = %s\n", mAppVersion.get()));
     LOG(("> compat-firefox = %s\n", mCompatFirefox.get()));
@@ -620,8 +626,10 @@
                            mCompatFirefox.Length() +
                            mCompatDevice.Length() +
                            mDeviceModelId.Length() +
-                           13);
-
+#ifdef MOZ_UA_VENDOR
+                           mVendor.Length() + 
+#endif
+                           15);
     // Application portion
     mUserAgent.Assign(mLegacyAppName);
     mUserAgent += '/';
@@ -636,6 +644,10 @@
       mUserAgent.AppendLiteral("; ");
     }
 #endif
+#ifdef MOZ_UA_VENDOR
+    mUserAgent += mVendor;
+    mUserAgent.AppendLiteral("; ");
+#endif
     if (!mCompatDevice.IsEmpty()) {
         mUserAgent += mCompatDevice;
         mUserAgent.AppendLiteral("; ");
Index: firefox-trunk-39.0~a1~hg20150319r234403/netwerk/protocol/http/nsHttpHandler.h
===================================================================
--- firefox-trunk-39.0~a1~hg20150319r234403.orig/netwerk/protocol/http/nsHttpHandler.h	2015-03-19 22:06:15.726198019 +0000
+++ firefox-trunk-39.0~a1~hg20150319r234403/netwerk/protocol/http/nsHttpHandler.h	2015-03-19 22:06:15.722198001 +0000
@@ -435,6 +435,7 @@
     // useragent components
     nsCString      mLegacyAppName;
     nsCString      mLegacyAppVersion;
+    nsCString      mVendor;
     nsCString      mPlatform;
     nsCString      mOscpu;
     nsCString      mMisc;
Index: firefox-trunk-39.0~a1~hg20150319r234403/netwerk/protocol/http/Makefile.in
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ firefox-trunk-39.0~a1~hg20150319r234403/netwerk/protocol/http/Makefile.in	2015-03-19 22:06:15.722198001 +0000
@@ -0,0 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+include $(topsrcdir)/config/rules.mk
+
+ifdef MOZ_UA_VENDOR
+DEFINES += -DMOZ_UA_VENDOR=\""$(MOZ_UA_VENDOR)"\"
+endif