2016-11-14 21:45:26 +00:00
|
|
|
diff -up firefox-50.0/modules/libpref/prefapi.cpp.440908 firefox-50.0/modules/libpref/prefapi.cpp
|
|
|
|
--- firefox-50.0/modules/libpref/prefapi.cpp.440908 2016-10-31 21:15:26.000000000 +0100
|
|
|
|
+++ firefox-50.0/modules/libpref/prefapi.cpp 2016-11-10 10:32:48.796115692 +0100
|
|
|
|
@@ -997,8 +997,8 @@ void PREF_ReaderCallback(void *clo
|
2016-03-21 13:40:15 +00:00
|
|
|
PrefValue value,
|
|
|
|
PrefType type,
|
|
|
|
bool isDefault,
|
|
|
|
- bool isStickyDefault)
|
2016-06-02 10:32:28 +00:00
|
|
|
-
|
2016-03-21 13:40:15 +00:00
|
|
|
+ bool isStickyDefault,
|
|
|
|
+ bool isLocked)
|
|
|
|
{
|
2016-06-02 10:32:28 +00:00
|
|
|
uint32_t flags = 0;
|
|
|
|
if (isDefault) {
|
2016-11-14 21:45:26 +00:00
|
|
|
@@ -1010,4 +1010,6 @@ void PREF_ReaderCallback(void *clo
|
2016-06-02 10:32:28 +00:00
|
|
|
flags |= kPrefForceSet;
|
2016-03-21 13:40:15 +00:00
|
|
|
}
|
|
|
|
pref_HashPref(pref, value, type, flags);
|
|
|
|
+ if (isLocked)
|
|
|
|
+ PREF_LockPref(pref, true);
|
|
|
|
}
|
2016-11-14 21:45:26 +00:00
|
|
|
diff -up firefox-50.0/modules/libpref/prefapi.h.440908 firefox-50.0/modules/libpref/prefapi.h
|
|
|
|
--- firefox-50.0/modules/libpref/prefapi.h.440908 2016-11-10 10:32:48.796115692 +0100
|
|
|
|
+++ firefox-50.0/modules/libpref/prefapi.h 2016-11-10 10:34:58.013159112 +0100
|
|
|
|
@@ -243,8 +243,8 @@ void PREF_ReaderCallback( void *closure,
|
2016-03-21 13:40:15 +00:00
|
|
|
PrefValue value,
|
|
|
|
PrefType type,
|
|
|
|
bool isDefault,
|
|
|
|
- bool isStickyDefault);
|
2016-11-14 21:45:26 +00:00
|
|
|
-
|
2016-03-21 13:40:15 +00:00
|
|
|
+ bool isStickyDefault,
|
|
|
|
+ bool isLocked);
|
|
|
|
|
2016-11-14 21:45:26 +00:00
|
|
|
/*
|
|
|
|
* Callback whenever we change a preference
|
|
|
|
diff -up firefox-50.0/modules/libpref/prefread.cpp.440908 firefox-50.0/modules/libpref/prefread.cpp
|
|
|
|
--- firefox-50.0/modules/libpref/prefread.cpp.440908 2016-09-05 22:12:58.000000000 +0200
|
|
|
|
+++ firefox-50.0/modules/libpref/prefread.cpp 2016-11-10 10:32:48.796115692 +0100
|
2016-03-21 13:40:15 +00:00
|
|
|
@@ -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";
|
2016-09-08 11:37:25 +00:00
|
|
|
@@ -146,7 +147,7 @@ pref_DoCallback(PrefParseState *ps)
|
2016-03-21 13:40:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
(*ps->reader)(ps->closure, ps->lb, value, ps->vtype, ps->fdefault,
|
|
|
|
- ps->fstickydefault);
|
|
|
|
+ ps->fstickydefault, ps->flock);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-09-08 11:37:25 +00:00
|
|
|
@@ -215,6 +216,7 @@ PREF_ParseBuf(PrefParseState *ps, const
|
2016-06-02 10:32:28 +00:00
|
|
|
ps->vtype = PrefType::Invalid;
|
2016-03-21 13:40:15 +00:00
|
|
|
ps->fdefault = false;
|
|
|
|
ps->fstickydefault = false;
|
|
|
|
+ ps->flock = false;
|
|
|
|
}
|
|
|
|
switch (c) {
|
|
|
|
case '/': /* begin comment block or line? */
|
2016-09-08 11:37:25 +00:00
|
|
|
@@ -225,11 +227,14 @@ PREF_ParseBuf(PrefParseState *ps, const
|
2016-06-02 10:32:28 +00:00
|
|
|
break;
|
2016-03-21 13:40:15 +00:00
|
|
|
case 'u': /* indicating user_pref */
|
|
|
|
case 's': /* indicating sticky_pref */
|
|
|
|
+ case 'l': /* indicating lockPref */
|
2016-06-02 10:32:28 +00:00
|
|
|
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;
|
|
|
|
}
|
2016-09-08 11:37:25 +00:00
|
|
|
@@ -277,8 +282,10 @@ PREF_ParseBuf(PrefParseState *ps, const
|
2016-03-21 13:40:15 +00:00
|
|
|
/* 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;
|
2016-11-14 21:45:26 +00:00
|
|
|
diff -up firefox-50.0/modules/libpref/prefread.h.440908 firefox-50.0/modules/libpref/prefread.h
|
|
|
|
--- firefox-50.0/modules/libpref/prefread.h.440908 2016-09-05 22:12:58.000000000 +0200
|
|
|
|
+++ firefox-50.0/modules/libpref/prefread.h 2016-11-10 10:32:48.796115692 +0100
|
2016-06-02 10:32:28 +00:00
|
|
|
@@ -34,7 +34,8 @@ typedef void (*PrefReader)(void *c
|
2016-03-21 13:40:15 +00:00
|
|
|
PrefValue val,
|
|
|
|
PrefType type,
|
|
|
|
bool defPref,
|
|
|
|
- bool stickyPref);
|
|
|
|
+ bool stickyPref,
|
|
|
|
+ bool lockPref);
|
|
|
|
|
2016-09-08 11:37:25 +00:00
|
|
|
/**
|
|
|
|
* Report any errors or warnings we encounter during parsing.
|
|
|
|
@@ -62,6 +63,7 @@ typedef struct PrefParseState {
|
2016-03-21 13:40:15 +00:00
|
|
|
PrefType vtype; /* PREF_STRING,INT,BOOL */
|
2016-06-02 10:32:28 +00:00
|
|
|
bool fdefault; /* true if (default) pref */
|
2016-03-21 13:40:15 +00:00
|
|
|
bool fstickydefault; /* true if (sticky) pref */
|
|
|
|
+ bool flock; /* true if pref to be locked */
|
|
|
|
} PrefParseState;
|
|
|
|
|
2016-09-08 11:37:25 +00:00
|
|
|
/**
|
|
|
|
@@ -90,7 +92,7 @@ void PREF_InitParseState(PrefParseState
|
|
|
|
*
|
|
|
|
* @param ps
|
|
|
|
* PrefParseState instance.
|
|
|
|
- */
|
|
|
|
+ */
|
|
|
|
void PREF_FinalizeParseState(PrefParseState *ps);
|
|
|
|
|
2016-03-21 13:40:15 +00:00
|
|
|
/**
|