зеркало из https://github.com/mozilla/gecko-dev.git
Resource.js now always validates the cache (VALIDATE_ALWAYS) when downloading stuff. This seems to fix bug 480270 on Firefox but not on Fennec.
This commit is contained in:
Родитель
840b41e6b0
Коммит
4aef6ff6d2
|
@ -176,7 +176,7 @@ TabStore.prototype = {
|
|||
|
||||
for (let j = 0; j < window.tabs.length; j++) {
|
||||
let tab = window.tabs[j];
|
||||
this._log.debug( "tab state: " + uneval(tab));//this._sessionStore.getTabState(tab));
|
||||
//this._sessionStore.getTabState(tab));
|
||||
// Skip empty (i.e. just-opened, no history yet) tabs:
|
||||
if (tab.entries.length == 0)
|
||||
continue;
|
||||
|
@ -214,27 +214,20 @@ TabStore.prototype = {
|
|||
},
|
||||
|
||||
itemExists: function TabStore_itemExists(id) {
|
||||
this._log.debug("ItemExists called.");
|
||||
if (id == this._localClientGUID) {
|
||||
this._log.debug("It's me.");
|
||||
return true;
|
||||
} else if (this._remoteClients[id]) {
|
||||
this._log.debug("It's somebody else.");
|
||||
return true;
|
||||
} else {
|
||||
this._log.debug("It doesn't exist!");
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
createRecord: function TabStore_createRecord(id, cryptoMetaURL) {
|
||||
this._log.debug("CreateRecord called for id " + id );
|
||||
let record;
|
||||
if (id == this._localClientGUID) {
|
||||
this._log.debug("That's Me!");
|
||||
record = this._createLocalClientTabSetRecord();
|
||||
} else {
|
||||
this._log.debug("That's Somebody Else.");
|
||||
record = this._remoteClients[id];
|
||||
}
|
||||
record.id = id;
|
||||
|
@ -243,7 +236,6 @@ TabStore.prototype = {
|
|||
},
|
||||
|
||||
changeItemId: function TabStore_changeItemId(oldId, newId) {
|
||||
this._log.debug("changeItemId called.");
|
||||
if (this._remoteClients[oldId]) {
|
||||
let record = this._remoteClients[oldId];
|
||||
record.id = newId;
|
||||
|
@ -253,7 +245,6 @@ TabStore.prototype = {
|
|||
},
|
||||
|
||||
getAllIDs: function TabStore_getAllIds() {
|
||||
this._log.debug("getAllIds called.");
|
||||
let items = {};
|
||||
items[ this._localClientGUID ] = true;
|
||||
for (let id in this._remoteClients) {
|
||||
|
@ -265,7 +256,6 @@ TabStore.prototype = {
|
|||
wipe: function TabStore_wipe() {
|
||||
this._log.debug("Wipe called. Clearing cache of remote client tabs.");
|
||||
this._remoteClients = {};
|
||||
this._writeToFile();
|
||||
},
|
||||
|
||||
create: function TabStore_create(record) {
|
||||
|
|
|
@ -148,7 +148,13 @@ Resource.prototype = {
|
|||
let ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
this._lastChannel = ios.newChannel(this.spec, null, null).
|
||||
QueryInterface(Ci.nsIHttpChannel);
|
||||
QueryInterface(Ci.nsIRequest);
|
||||
// Always validate the cache:
|
||||
let loadFlags = this._lastChannel.loadFlags;
|
||||
loadFlags |= Ci.nsIRequest.VALIDATE_ALWAYS;
|
||||
this._lastChannel.loadFlags = loadFlags;
|
||||
this._lastChannel = this._lastChannel.QueryInterface(Ci.nsIHttpChannel);
|
||||
|
||||
this._lastChannel.notificationCallbacks = new badCertListener();
|
||||
|
||||
let headers = this.headers; // avoid calling the authorizer more than once
|
||||
|
|
|
@ -574,7 +574,9 @@ WeaveSvc.prototype = {
|
|||
this._log.debug("Fetching global metadata record");
|
||||
let meta = yield Records.import(self.cb, this.clusterURL +
|
||||
this.username + "/meta/global");
|
||||
|
||||
|
||||
this._log.debug("Min server storage version is " + MIN_SERVER_STORAGE_VERSION);
|
||||
this._log.debug("payload storage version is " + meta.payload.storageVersion);
|
||||
if (!meta || !meta.payload.storageVersion || !meta.payload.syncID ||
|
||||
Svc.Version.compare(MIN_SERVER_STORAGE_VERSION,
|
||||
meta.payload.storageVersion) > 0) {
|
||||
|
@ -811,6 +813,7 @@ WeaveSvc.prototype = {
|
|||
|
||||
this._log.debug("Uploading new metadata record");
|
||||
meta = new WBORecord(this.clusterURL + this.username + "/meta/global");
|
||||
this._log.debug("Setting meta payload storage version to " + WEAVE_VERSION);
|
||||
meta.payload.storageVersion = WEAVE_VERSION;
|
||||
meta.payload.syncID = Clients.syncID;
|
||||
let res = new Resource(meta.uri);
|
||||
|
|
Загрузка…
Ссылка в новой задаче