Backed out changeset 6f10f2e4ef13 (bug 960887) for XPC Bustage on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2014-01-30 10:39:59 +01:00
parent bddabadbe2
commit 0c86807f34
7 changed files with 12 additions and 44 deletions

View File

@ -478,14 +478,12 @@ BrowserIDClusterManager.prototype = {
let promiseClusterURL = function() {
return fxAccounts.getSignedInUser().then(userData => {
return this.identity._fetchTokenForUser(userData).then(token => {
let endpoint = token.endpoint;
// For Sync 1.5 storage endpoints, we use the base endpoint verbatim.
// However, it should end in "/" because we will extend it with
// well known path components. So we add a "/" if it's missing.
if (!endpoint.endsWith("/")) {
endpoint += "/";
}
return endpoint;
// Set the clusterURI for this user based on the endpoint in the
// token. This is a bit of a hack, and we should figure out a better
// way of distributing it to components that need it.
let clusterURI = Services.io.newURI(token.endpoint, null, null);
clusterURI.path = "/";
return clusterURI.spec;
});
});
}.bind(this);
@ -499,13 +497,4 @@ BrowserIDClusterManager.prototype = {
});
return cb.wait();
},
getUserBaseURL: function() {
// Legacy Sync and FxA Sync construct the userBaseURL differently. Legacy
// Sync appends path components onto an empty path, and in FxA Sync the
// token server constructs this for us in an opaque manner. Since the
// cluster manager already sets the clusterURL on Service and also has
// access to the current identity, we added this functionality here.
return this.service.clusterURL;
}
}

View File

@ -651,7 +651,8 @@ SyncEngine.prototype = {
// How many records to process in a single batch.
applyIncomingBatchSize: DEFAULT_STORE_BATCH_SIZE,
get storageURL() this.service.storageURL,
get storageURL() Svc.Prefs.get("clusterURL") + SYNC_API_VERSION +
"/" + this.service.identity.username + "/storage/",
get engineURL() this.storageURL + this.name,

View File

@ -60,6 +60,7 @@ Sync11Service.prototype = {
_locked: false,
_loggedIn: false,
userBaseURL: null,
infoURL: null,
storageURL: null,
metaURL: null,
@ -155,18 +156,13 @@ Sync11Service.prototype = {
return Utils.catch.call(this, func, lockExceptions);
},
get userBaseURL() {
if (!this._clusterManager) {
return null;
}
return this._clusterManager.getUserBaseURL();
},
_updateCachedURLs: function _updateCachedURLs() {
// Nothing to cache yet if we don't have the building blocks
if (this.clusterURL == "" || this.identity.username == "")
return;
let storageAPI = this.clusterURL + SYNC_API_VERSION + "/";
this.userBaseURL = storageAPI + this.identity.username + "/";
this._log.debug("Caching URLs under storage user base: " + this.userBaseURL);
// Generate and cache various URLs under the storage API for this user

View File

@ -91,21 +91,5 @@ ClusterManager.prototype = {
return true;
},
getUserBaseURL: function getUserBaseURL() {
// Legacy Sync and FxA Sync construct the userBaseURL differently. Legacy
// Sync appends path components onto an empty path, and in FxA Sync, the
// token server constructs this for us in an opaque manner. Since the
// cluster manager already sets the clusterURL on Service and also has
// access to the current identity, we added this functionality here.
// If the clusterURL hasn't been set, the userBaseURL shouldn't be set
// either. Some tests expect "undefined" to be returned here.
if (!this.service.clusterURL) {
return undefined;
}
let storageAPI = this.service.clusterURL + SYNC_API_VERSION + "/";
return storageAPI + this.identity.username + "/";
}
};
Object.freeze(ClusterManager.prototype);

View File

@ -7,7 +7,7 @@ Cu.import("resource://services-sync/util.js");
Cu.import("resource://testing-common/services/sync/fakeservices.js");
function test_urls() {
_("URL related Service properties correspond to preference settings.");
_("URL related Service properties corresopnd to preference settings.");
try {
do_check_true(!!Service.serverURL); // actual value may change
do_check_eq(Service.clusterURL, "");

View File

@ -48,7 +48,6 @@ function createServerAndConfigureClient() {
Service.serverURL = server.baseURI;
Service.clusterURL = server.baseURI;
Service.identity.username = USER;
Service._updateCachedURLs();
return [engine, server, USER];
}

View File

@ -103,7 +103,6 @@ skip-if = os == "mac" || os == "linux"
[test_corrupt_keys.js]
[test_errorhandler.js]
skip-if = true # Temp disabled, but 960887:
[test_errorhandler_filelog.js]
# Bug 676978: test hangs on Android (see also testing/xpcshell/xpcshell.ini)
skip-if = os == "android"