зеркало из https://github.com/mozilla/gecko-dev.git
Bug 804754 - Add UAProfile url into HTTP request header. r=vyang
This commit is contained in:
Родитель
b3d7679edb
Коммит
b6f7216c45
|
@ -591,3 +591,7 @@ pref("font.size.inflation.disabledInMasterProcess", true);
|
|||
// Enable freeing dirty pages when minimizing memory; this reduces memory
|
||||
// consumption when applications are sent to the background.
|
||||
pref("memory.free_dirty_pages", true);
|
||||
|
||||
// UAProfile settings
|
||||
pref("wap.UAProf.url", "");
|
||||
pref("wap.UAProf.tagname", "x-wap-profile");
|
||||
|
|
|
@ -57,6 +57,16 @@ XPCOMUtils.defineLazyGetter(this, "MMS", function () {
|
|||
function MmsService() {
|
||||
Services.obs.addObserver(this, kXpcomShutdownObserverTopic, false);
|
||||
Services.obs.addObserver(this, kNetworkInterfaceStateChangedTopic, false);
|
||||
try {
|
||||
this.urlUAProf = Services.prefs.getCharPref('wap.UAProf.url');
|
||||
} catch (e) {
|
||||
this.urlUAProf = "";
|
||||
}
|
||||
try {
|
||||
this.tagnameUAProf = Services.prefs.getCharPref('wap.UAProf.tagname');
|
||||
} catch (e) {
|
||||
this.tagnameUAProf = "x-wap-profile";
|
||||
}
|
||||
}
|
||||
MmsService.prototype = {
|
||||
|
||||
|
@ -78,6 +88,10 @@ MmsService.prototype = {
|
|||
/** MMS proxy filter reference count. */
|
||||
proxyFilterRefCount: 0,
|
||||
|
||||
// WebMMS
|
||||
urlUAProf: null,
|
||||
tagnameUAProf: null,
|
||||
|
||||
/**
|
||||
* Calculate Whether or not should we enable X-Mms-Report-Allowed.
|
||||
*
|
||||
|
@ -159,6 +173,10 @@ MmsService.prototype = {
|
|||
xhr.setRequestHeader("Content-Length", 0);
|
||||
}
|
||||
|
||||
if(this.urlUAProf !== "") {
|
||||
xhr.setRequestHeader(this.tagnameUAProf, this.urlUAProf);
|
||||
}
|
||||
|
||||
// Setup event listeners
|
||||
xhr.onerror = function () {
|
||||
debug("xhr error, response headers: " + xhr.getAllResponseHeaders());
|
||||
|
|
|
@ -3872,3 +3872,8 @@ pref("dom.browserElement.maxScreenshotDelayMS", 2000);
|
|||
|
||||
// Whether we should show the placeholder when the element is focused but empty.
|
||||
pref("dom.placeholder.show_on_focus", true);
|
||||
|
||||
// UAProfile settings
|
||||
pref("wap.UAProf.url", "");
|
||||
pref("wap.UAProf.tagname", "x-wap-profile");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче