~jbicha/firefox/update-dependencies

« back to all changes in this revision

Viewing changes to debian/patches/allow-lockPref-everywhere.patch

  • Committer: Rico Tzschichholz
  • Date: 2017-02-02 07:48:01 UTC
  • Revision ID: ricotz@ubuntu.com-20170202074801-qgdtrnkp1tu1sdm6
* New upstream release from the beta channel (FIREFOX_52_0b2_BUILD1)
* Unconditionally build-dep on libffi-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=467738
4
4
Forwarded: https://bugzilla.mozilla.org/attachment.cgi?id=351145
5
5
 
6
 
Index: firefox-trunk-58.0~a1~hg20171110r391326/modules/libpref/Preferences.cpp
 
6
---
 
7
 modules/libpref/src/prefapi.cpp  |    5 ++++-
 
8
 modules/libpref/src/prefapi.h    |    3 ++-
 
9
 modules/libpref/src/prefread.cpp |   11 ++++++++---
 
10
 modules/libpref/src/prefread.h   |    4 +++-
 
11
 4 files changed, 17 insertions(+), 6 deletions(-)
 
12
 
 
13
Index: firefox-trunk-50.0~a1~hg20160801r307508/modules/libpref/prefread.cpp
7
14
===================================================================
8
 
--- firefox-trunk-58.0~a1~hg20171110r391326.orig/modules/libpref/Preferences.cpp
9
 
+++ firefox-trunk-58.0~a1~hg20171110r391326/modules/libpref/Preferences.cpp
10
 
@@ -1185,7 +1185,8 @@
11
 
                     PrefValue aValue,
12
 
                     PrefType aType,
13
 
                     bool aIsDefault,
14
 
-                    bool aIsStickyDefault)
15
 
+                    bool aIsStickyDefault,
16
 
+                    bool aIsLocked)
17
 
 {
18
 
   uint32_t flags = 0;
19
 
   if (aIsDefault) {
20
 
@@ -1197,6 +1198,8 @@
21
 
     flags |= kPrefForceSet;
22
 
   }
23
 
   pref_SetPref(aPref, aValue, aType, flags);
24
 
+  if (aIsLocked)
25
 
+    PREF_LockPref(aPref, true);
26
 
 }
27
 
 
28
 
 //===========================================================================
29
 
@@ -1218,7 +1221,8 @@
30
 
                            PrefValue aValue,
31
 
                            PrefType aType,
32
 
                            bool aIsDefault,
33
 
-                           bool aIsStickyDefault);
34
 
+                           bool aIsStickyDefault,
35
 
+                           bool aIsLocked);
36
 
 
37
 
 // Report any errors or warnings we encounter during parsing.
38
 
 typedef void (*PrefParseErrorReporter)(const char* aMessage,
39
 
@@ -1246,6 +1250,7 @@
40
 
   PrefType mVtype;       // PREF_{STRING,INT,BOOL}
41
 
   bool mIsDefault;       // true if (default) pref
42
 
   bool mIsStickyDefault; // true if (sticky) pref
43
 
+  bool mIsLock;          // true if (locked) pref
44
 
 };
45
 
 
46
 
 // Pref parser states.
47
 
@@ -1275,6 +1280,7 @@
48
 
 #define BITS_PER_HEX_DIGIT 4
 
15
--- firefox-trunk-50.0~a1~hg20160801r307508.orig/modules/libpref/prefread.cpp
 
16
+++ firefox-trunk-50.0~a1~hg20160801r307508/modules/libpref/prefread.cpp
 
17
@@ -43,6 +43,7 @@ enum {
 
18
 #define BITS_PER_HEX_DIGIT      4
49
19
 
50
20
 static const char kUserPref[] = "user_pref";
51
21
+static const char kLockPref[] = "lockPref";
52
22
 static const char kPref[] = "pref";
53
23
 static const char kPrefSticky[] = "sticky_pref";
54
24
 static const char kTrue[] = "true";
55
 
@@ -1422,6 +1428,7 @@
56
 
           aPS->mVtype = PrefType::Invalid;
57
 
           aPS->mIsDefault = false;
58
 
           aPS->mIsStickyDefault = false;
59
 
+          aPS->mIsLock = false;
60
 
         }
61
 
         switch (c) {
62
 
           case '/': // begin comment block or line?
63
 
@@ -1432,11 +1439,14 @@
64
 
             break;
65
 
           case 'u': // indicating user_pref
66
 
           case 's': // indicating sticky_pref
67
 
+          case 'l': // indicating lockPref
68
 
           case 'p': // indicating pref
69
 
             if (c == 'u') {
70
 
               aPS->mStrMatch = kUserPref;
71
 
             } else if (c == 's') {
72
 
               aPS->mStrMatch = kPrefSticky;
73
 
+            } else if (c == 'l') {
74
 
+              aPS->mStrMatch = kLockPref;
75
 
             } else {
76
 
               aPS->mStrMatch = kPref;
 
25
@@ -146,7 +147,7 @@ pref_DoCallback(PrefParseState *ps)
 
26
         break;
 
27
     }
 
28
     (*ps->reader)(ps->closure, ps->lb, value, ps->vtype, ps->fdefault,
 
29
-                  ps->fstickydefault);
 
30
+                  ps->fstickydefault, ps->flock);
 
31
     return true;
 
32
 }
 
33
 
 
34
@@ -215,6 +216,7 @@ PREF_ParseBuf(PrefParseState *ps, const
 
35
                 ps->vtype = PrefType::Invalid;
 
36
                 ps->fdefault = false;
 
37
                 ps->fstickydefault = false;
 
38
+                ps->flock = false;
77
39
             }
78
 
@@ -1485,8 +1495,9 @@
79
 
       case PREF_PARSE_UNTIL_NAME:
80
 
         if (c == '\"' || c == '\'') {
81
 
           aPS->mIsDefault =
82
 
-            (aPS->mStrMatch == kPref || aPS->mStrMatch == kPrefSticky);
83
 
+            (aPS->mStrMatch == kPref || aPS->mStrMatch == kPrefSticky || aPS->mStrMatch == kLockPref);
84
 
           aPS->mIsStickyDefault = (aPS->mStrMatch == kPrefSticky);
85
 
+          aPS->mIsLock = (aPS->mStrMatch == kLockPref);
86
 
           aPS->mQuoteChar = c;
87
 
           aPS->mNextState = PREF_PARSE_UNTIL_COMMA; // return here when done
88
 
           state = PREF_PARSE_QUOTED_STRING;
89
 
@@ -1815,7 +1826,8 @@
90
 
                        value,
91
 
                        aPS->mVtype,
92
 
                        aPS->mIsDefault,
93
 
-                       aPS->mIsStickyDefault);
94
 
+                       aPS->mIsStickyDefault,
95
 
+                       aPS->mIsLock);
96
 
 
97
 
           state = PREF_PARSE_INIT;
98
 
         } else if (c == '/') {
 
40
             switch (c) {
 
41
             case '/':       /* begin comment block or line? */
 
42
@@ -225,11 +227,14 @@ PREF_ParseBuf(PrefParseState *ps, const
 
43
                 break;
 
44
             case 'u':       /* indicating user_pref */
 
45
             case 's':       /* indicating sticky_pref */
 
46
+            case 'l':       /* indicating lockPref */
 
47
             case 'p':       /* indicating pref */
 
48
                 if (c == 'u') {
 
49
                   ps->smatch = kUserPref;
 
50
                 } else if (c == 's') {
 
51
                   ps->smatch = kPrefSticky;
 
52
+                } else if (c == 'l') {
 
53
+                  ps->smatch = kLockPref;
 
54
                 } else {
 
55
                   ps->smatch = kPref;
 
56
                 }
 
57
@@ -277,8 +282,10 @@ PREF_ParseBuf(PrefParseState *ps, const
 
58
         /* name parsing */
 
59
         case PREF_PARSE_UNTIL_NAME:
 
60
             if (c == '\"' || c == '\'') {
 
61
-                ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky);
 
62
+                ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky ||
 
63
+                                ps->smatch == kLockPref);
 
64
                 ps->fstickydefault = (ps->smatch == kPrefSticky);
 
65
+                ps->flock = (ps->smatch == kLockPref);
 
66
                 ps->quotechar = c;
 
67
                 ps->nextstate = PREF_PARSE_UNTIL_COMMA; /* return here when done */
 
68
                 state = PREF_PARSE_QUOTED_STRING;
 
69
Index: firefox-trunk-50.0~a1~hg20160801r307508/modules/libpref/prefread.h
 
70
===================================================================
 
71
--- firefox-trunk-50.0~a1~hg20160801r307508.orig/modules/libpref/prefread.h
 
72
+++ firefox-trunk-50.0~a1~hg20160801r307508/modules/libpref/prefread.h
 
73
@@ -34,7 +34,8 @@ typedef void (*PrefReader)(void       *c
 
74
                            PrefValue   val,
 
75
                            PrefType    type,
 
76
                            bool        defPref,
 
77
-                           bool        stickyPref);
 
78
+                           bool        stickyPref,
 
79
+                           bool        lockPref);
 
80
 
 
81
 /**
 
82
  * Report any errors or warnings we encounter during parsing.
 
83
@@ -62,6 +63,7 @@ typedef struct PrefParseState {
 
84
     PrefType    vtype;      /* PREF_STRING,INT,BOOL          */
 
85
     bool        fdefault;   /* true if (default) pref        */
 
86
     bool        fstickydefault; /* true if (sticky) pref     */
 
87
+    bool        flock;      /* true if (locked) pref         */
 
88
 } PrefParseState;
 
89
 
 
90
 /**
 
91
Index: firefox-trunk-50.0~a1~hg20160801r307508/modules/libpref/prefapi.cpp
 
92
===================================================================
 
93
--- firefox-trunk-50.0~a1~hg20160801r307508.orig/modules/libpref/prefapi.cpp
 
94
+++ firefox-trunk-50.0~a1~hg20160801r307508/modules/libpref/prefapi.cpp
 
95
@@ -997,7 +997,8 @@ void PREF_ReaderCallback(void       *clo
 
96
                          PrefValue   value,
 
97
                          PrefType    type,
 
98
                          bool        isDefault,
 
99
-                         bool        isStickyDefault)
 
100
+                         bool        isStickyDefault,
 
101
+                         bool        isLocked)
 
102
 
 
103
 {
 
104
     uint32_t flags = 0;
 
105
@@ -1010,4 +1011,6 @@ void PREF_ReaderCallback(void       *clo
 
106
         flags |= kPrefForceSet;
 
107
     }
 
108
     pref_HashPref(pref, value, type, flags);
 
109
+    if (isLocked)
 
110
+       PREF_LockPref(pref, true);
 
111
 }
 
112
Index: firefox-trunk-50.0~a1~hg20160801r307508/modules/libpref/prefapi.h
 
113
===================================================================
 
114
--- firefox-trunk-50.0~a1~hg20160801r307508.orig/modules/libpref/prefapi.h
 
115
+++ firefox-trunk-50.0~a1~hg20160801r307508/modules/libpref/prefapi.h
 
116
@@ -243,7 +243,8 @@ void PREF_ReaderCallback( void *closure,
 
117
                           PrefValue   value,
 
118
                           PrefType    type,
 
119
                           bool        isDefault,
 
120
-                          bool        isStickyDefault);
 
121
+                          bool        isStickyDefault,
 
122
+                          bool        isLocked);
 
123
 
 
124
 
 
125
 /*