Removed some lines that were only in there for debugging purposes.
authorjono@jono-gibbon-laptop
Tue, 01 Apr 2008 19:12:03 -0700
changeset 44414 890970bcb57ad853da749d506897d0a03317c1c3
parent 44413 ec3a174489a3bda09960f464cb4f3dec772aa851
child 44415 19e1411b926f5867b66fe3e8f55c0e25a41c74d3
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
Removed some lines that were only in there for debugging purposes.
services/sync/modules/stores.js
services/sync/modules/syncCores.js
--- a/services/sync/modules/stores.js
+++ b/services/sync/modules/stores.js
@@ -776,18 +776,16 @@ CookieStore.prototype = {
     return this.__cookieManager
   },
 
   _createCommand: function HistStore__createCommand(command) {
 	// we got a command to create a cookie in the local browser
         // in order to sync with the server.
 
 	this._log.info("CookieStore got createCommand: " + command );
-        if (this._cookieManager == null )
-	    throw "Cookie manager is null in CookieStore._createCommand.";
         // this assumes command.data fits the nsICookie2 interface
 	this._cookieManager.add( command.data.host,
 				  command.data.path,
 				  command.data.name,
 				  command.data.value,
 				  command.data.isSecure,
 				  command.data.isSession,
 				  command.data.expiry );
@@ -800,41 +798,40 @@ CookieStore.prototype = {
         // the JSON dictionary.
     
         this._log.info("CookieStore got removeCommand: " + command );
 
         // I think it goes like this, according to 
         // http://developer.mozilla.org/en/docs/nsICookieManager
         // the last argument is "always block cookies from this domain?"
 	// and the answer is "no".
-        if (this._cookieManager == null )
-	    throw "Cookie manager is null in CookieStore._removeCommand.";
 	this._cookieManager.remove( command.data.host,
                                     command.data.name,
 				    command.data.path,
                                     false );
   },
 
   _editCommand: function CookieStore__editCommand(command) {
         // we got a command to change a cookie in the local browser
         // in order to sync with the server.
     
-	// TODO implement this!!
+	// TODO implement this!!  The behavior should be that if the
+        // local copy of the cookie is more-recently modified, it should
+        // be kept, but if it's older, it should be replaced with the
+        // server's copy.
         this._log.info("CookieStore got editCommand: " + command );
   },
 
 
   wrap: function CookieStore_wrap() {
 	// Return contents of this store, as JSON.
         // A dictionary of cookies where the keys are GUIDs and the
         // values are sub-dictionaries containing all cookie fields.
 
 	let items = {};
-        if (this._cookieManager == null )
-	    throw "Cookie manager is null in CookieStore.wrap.";
 	var iter = this._cookieManager.enumerator;
 	while (iter.hasMoreElements()){
 	    var cookie = iter.getNext();
 	    if (cookie instanceof Ci.nsICookie){
                 // String used to identify cookies is
 		// host:path:name
                 let key = cookie.host + ":" + cookie.path + ":" + cookie.name
 		items[ key ] = { parentGUID: '',
@@ -859,18 +856,16 @@ CookieStore.prototype = {
     return items;
   },
 
   wipe: function CookieStore_wipe() {
 	// Remove everything from the store.  Return nothing.
         // TODO are the semantics of this just wiping out an internal
         // buffer, or am I supposed to wipe out all cookies from
         // the browser itself for reals?
-        if (this._cookieManager == null )
-	    throw "Cookie manager is null in CookieStore.wipe";
         this._cookieManager.removeAll()
   },
 
   resetGUIDs: function CookieStore_resetGUIDs() {
       // called in the case where remote/local sync GUIDs do not
       // match.  We do need to override this, but since we're deriving
       // GUIDs from the cookie data itself and not generating them,
       // there's basically no way they can get "out of sync" so there's
--- a/services/sync/modules/syncCores.js
+++ b/services/sync/modules/syncCores.js
@@ -462,18 +462,16 @@ CookieSyncCore.prototype = {
         let unused = 0; // for outparam from findMatchingCookie
 	let cookieArray = GUID.split( ":" );
         // create a generic object to represent the cookie -- just has
 	// to implement nsICookie2 interface.
 	cookie = Object();
 	cookie.host = cookieArray[0];
 	cookie.path = cookieArray[1];
 	cookie.name = cookieArray[2];
-        if (this._cookieManager == null )
-	    throw "Cookie manager is null in CookieSyncCore._itemExists.";
     	return this._cookieManager.findMatchingCookie( cookie, unused );
   },
 
   _commandLike: function CSC_commandLike(a, b) {
         // Method required to be overridden.
         // a and b each have a .data and a .GUID
 	// If this function returns true, an editCommand will be
 	// generated to try to resolve the thing.