firefox/mozilla-440908.patch

111 lines
4.9 KiB
Diff

diff -up firefox-47.0/modules/libpref/prefapi.cpp.440908 firefox-47.0/modules/libpref/prefapi.cpp
--- firefox-47.0/modules/libpref/prefapi.cpp.440908 2016-06-01 17:17:19.723700226 +0200
+++ firefox-47.0/modules/libpref/prefapi.cpp 2016-06-01 17:21:05.839971471 +0200
@@ -947,8 +947,8 @@ void PREF_ReaderCallback(void *clo
PrefValue value,
PrefType type,
bool isDefault,
- bool isStickyDefault)
-
+ bool isStickyDefault,
+ bool isLocked)
{
uint32_t flags = 0;
if (isDefault) {
@@ -960,4 +960,6 @@ void PREF_ReaderCallback(void *clo
flags |= kPrefForceSet;
}
pref_HashPref(pref, value, type, flags);
+ if (isLocked)
+ PREF_LockPref(pref, true);
}
diff -up firefox-47.0/modules/libpref/prefapi.h.440908 firefox-47.0/modules/libpref/prefapi.h
--- firefox-47.0/modules/libpref/prefapi.h.440908 2016-06-01 06:11:44.000000000 +0200
+++ firefox-47.0/modules/libpref/prefapi.h 2016-06-01 17:17:19.723700226 +0200
@@ -243,7 +243,8 @@ void PREF_ReaderCallback( void *closure,
PrefValue value,
PrefType type,
bool isDefault,
- bool isStickyDefault);
+ bool isStickyDefault,
+ bool isLocked);
#ifdef __cplusplus
}
diff -up firefox-47.0/modules/libpref/prefread.cpp.440908 firefox-47.0/modules/libpref/prefread.cpp
--- firefox-47.0/modules/libpref/prefread.cpp.440908 2016-06-01 06:11:44.000000000 +0200
+++ firefox-47.0/modules/libpref/prefread.cpp 2016-06-01 17:29:47.017596668 +0200
@@ -43,6 +43,7 @@ enum {
#define BITS_PER_HEX_DIGIT 4
static const char kUserPref[] = "user_pref";
+static const char kLockPref[] = "lockPref";
static const char kPref[] = "pref";
static const char kPrefSticky[] = "sticky_pref";
static const char kTrue[] = "true";
@@ -131,7 +132,7 @@ pref_DoCallback(PrefParseState *ps)
break;
}
(*ps->reader)(ps->closure, ps->lb, value, ps->vtype, ps->fdefault,
- ps->fstickydefault);
+ ps->fstickydefault, ps->flock);
return true;
}
@@ -191,6 +192,7 @@ PREF_ParseBuf(PrefParseState *ps, const
ps->vtype = PrefType::Invalid;
ps->fdefault = false;
ps->fstickydefault = false;
+ ps->flock = false;
}
switch (c) {
case '/': /* begin comment block or line? */
@@ -201,11 +203,14 @@ PREF_ParseBuf(PrefParseState *ps, const
break;
case 'u': /* indicating user_pref */
case 's': /* indicating sticky_pref */
+ case 'l': /* indicating lockPref */
case 'p': /* indicating pref */
if (c == 'u') {
ps->smatch = kUserPref;
} else if (c == 's') {
ps->smatch = kPrefSticky;
+ } else if (c == 'l') {
+ ps->smatch = kLockPref;
} else {
ps->smatch = kPref;
}
@@ -252,8 +257,10 @@ PREF_ParseBuf(PrefParseState *ps, const
/* name parsing */
case PREF_PARSE_UNTIL_NAME:
if (c == '\"' || c == '\'') {
- ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky);
+ ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky
+ || ps->smatch == kLockPref);
ps->fstickydefault = (ps->smatch == kPrefSticky);
+ ps->flock = (ps->smatch == kLockPref);
ps->quotechar = c;
ps->nextstate = PREF_PARSE_UNTIL_COMMA; /* return here when done */
state = PREF_PARSE_QUOTED_STRING;
diff -up firefox-47.0/modules/libpref/prefread.h.440908 firefox-47.0/modules/libpref/prefread.h
--- firefox-47.0/modules/libpref/prefread.h.440908 2016-06-01 06:11:44.000000000 +0200
+++ firefox-47.0/modules/libpref/prefread.h 2016-06-01 17:30:32.310651004 +0200
@@ -34,7 +34,8 @@ typedef void (*PrefReader)(void *c
PrefValue val,
PrefType type,
bool defPref,
- bool stickyPref);
+ bool stickyPref,
+ bool lockPref);
/* structure fields are private */
typedef struct PrefParseState {
@@ -56,6 +57,7 @@ typedef struct PrefParseState {
PrefType vtype; /* PREF_STRING,INT,BOOL */
bool fdefault; /* true if (default) pref */
bool fstickydefault; /* true if (sticky) pref */
+ bool flock; /* true if pref to be locked */
} PrefParseState;
/**