Bug 1195974 - Backout bug 1186547 for regresions. a=philipp
authorPhilipp Kewisch <mozilla@kewis.ch>
Fri, 04 Sep 2015 14:51:58 +0200
changeset 23092 45663d9662d2c553c82d78c788a671a498535f31
parent 23091 be7afe3e6d1d9e13acc5a14b0318a88490e1a016
child 23093 678110ba41d94d46cd90e3f7d8a6c6a9d67963ed
push id1474
push usermbanner@mozilla.com
push dateMon, 21 Sep 2015 17:20:48 +0000
treeherdercomm-beta@3094bab4c31f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp
bugs1195974, 1186547
Bug 1195974 - Backout bug 1186547 for regresions. a=philipp
calendar/providers/caldav/calDavCalendar.js
calendar/providers/caldav/calDavRequestHandlers.js
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -50,16 +50,17 @@ function caldavXPathFirst(aNode, aExpr, 
     return cal.xml.evalXPathFirst(aNode, aExpr, caldavNSResolver, aType);
 }
 
 function calDavCalendar() {
     this.initProviderBase();
     this.unmappedProperties = [];
     this.mUriParams = null;
     this.mItemInfoCache = {};
+    this.mDisabled = false;
     this.mCalHomeSet = null;
     this.mInboxUrl = null;
     this.mOutboxUrl = null;
     this.mCalendarUserAddress = null;
     this.mPrincipalUrl = null;
     this.mSenderAddress = null;
     this.mHrefIndex = {};
     this.mAuthScheme = null;
@@ -394,16 +395,18 @@ calDavCalendar.prototype = {
 
     //
     // calICalendar interface
     //
 
     // readonly attribute AUTF8String type;
     get type() { return "caldav"; },
 
+    mDisabled: true,
+
     mCalendarUserAddress: null,
     get calendarUserAddress() {
         return this.mCalendarUserAddress;
     },
 
     mPrincipalUrl: null,
     get principalUrl() {
         return this.mPrincipalUrl;
@@ -1401,17 +1404,17 @@ calDavCalendar.prototype = {
                 return;
             }
 
             if (request.responseStatus == 404) {
                 cal.LOG("CalDAV: Disabling calendar " + thisCalendar.name +
                         " due to 404");
                 notifyListener(Components.results.NS_ERROR_FAILURE);
                 return;
-            } else if (request.responseStatus == 207 && thisCalendar.getProperty("disabled")) {
+            } else if (request.responseStatus == 207 && thisCalendar.mDisabled) {
                 // Looks like the calendar is there again, check its resource
                 // type first.
                 thisCalendar.setupAuthentication(aChangeLogListener);
                 return;
              }
 
             let str = cal.convertByteArray(aResult, aResultLength);
             if (!str) {
@@ -1499,17 +1502,17 @@ calDavCalendar.prototype = {
      * @param aUri                  The uri to request the items from.
      *                                NOTE: This must be the uri without any uri
      *                                     params. They will be appended in this
      *                                     function.
      * @param aChangeLogListener    (optional) The listener to notify for cached
      *                                         calendars.
      */
     getUpdatedItems: function caldav_getUpdatedItems(aUri, aChangeLogListener) {
-        if (this.getProperty("disabled")) {
+        if (this.mDisabled) {
             // check if maybe our calendar has become available
             this.setupAuthentication(aChangeLogListener);
             return;
         }
 
         if (this.mHasWebdavSyncSupport) {
             webDavSync = new webDavSyncHandler(this,aUri,aChangeLogListener);
             webDavSync.doWebDAVSync();
@@ -1874,19 +1877,19 @@ calDavCalendar.prototype = {
                 cal.LOG("CalDAV: " + thisCalendar.name + " points to a DAV resource, but not a CalDAV calendar");
                 thisCalendar.completeCheckServerInfo(aChangeLogListener,
                                                      Components.interfaces.calIErrors.DAV_DAV_NOT_CALDAV);
                 return;
             }
 
             if (resourceType == kDavResourceTypeCalendar) {
                 // If this calendar was previously offline we want to recover
-                if (thisCalendar.getProperty("disabled")) {
-                    thisCalendar.setProperty("disabled", false);
-                    thisCalendar.readOnly = false;
+                if (thisCalendar.mDisabled) {
+                    thisCalendar.mDisabled = false;
+                    thisCalendar.mReadOnly = false;
                 }
                 thisCalendar.setCalHomeSet(true);
                 thisCalendar.checkServerCaps(aChangeLogListener);
                 return;
             }
 
             // If we get here something must have gone wrong. Abort with a
             // general error to avoid an endless loop.
@@ -2329,18 +2332,18 @@ calDavCalendar.prototype = {
         var localizedMessage;
         var modificationError = mapModification[aErrNo];
 
         if (!message) {
             // Only notify if there is a message for this error
             return;
         }
         localizedMessage = cal.calGetString("calendar", message , [this.mUri.spec]);
-        this.setProperty("disabled", true);
-        this.readOnly = true;
+        this.mReadOnly = true;
+        this.mDisabled = true;
         this.notifyError(aErrNo, localizedMessage);
         this.notifyError(modificationError
                          ? Components.interfaces.calIErrors.MODIFICATION_FAILED
                          : Components.interfaces.calIErrors.READ_FAILED,
                          this.buildDetailedMessage(status, extraInfo));
     },
 
     buildDetailedMessage : function caldav_buildDetailedMessage(status, extraInfo) {
--- a/calendar/providers/caldav/calDavRequestHandlers.js
+++ b/calendar/providers/caldav/calDavRequestHandlers.js
@@ -313,17 +313,17 @@ webDavSyncHandler.prototype = {
     QueryInterface: XPCOMUtils.generateQI([
         Components.interfaces.nsISAXContentHandler,
         Components.interfaces.nsISAXErrorHandler,
         Components.interfaces.nsIRequestObserver,
         Components.interfaces.nsIStreamListener
     ]),
 
     doWebDAVSync: function doWebDAVSync() {
-        if (this.calendar.getProperty("disabled")) {
+        if (this.calendar.mDisabled) {
             // check if maybe our calendar has become available
             this.calendar.setupAuthentication(this.changeLogListener);
             return;
         }
 
 
         let syncTokenString = "<sync-token/>";
         if (this.calendar.mWebdavSyncToken && this.calendar.mWebdavSyncToken.length > 0) {
@@ -685,17 +685,17 @@ multigetSyncHandler.prototype = {
     QueryInterface: XPCOMUtils.generateQI([
         Components.interfaces.nsISAXContentHandler,
         Components.interfaces.nsISAXErrorHandler,
         Components.interfaces.nsIRequestObserver,
         Components.interfaces.nsIStreamListener
     ]),
 
     doMultiGet: function doMultiGet() {
-        if (this.calendar.getProperty("disabled")) {
+        if (this.calendar.mDisabled) {
             // check if maybe our calendar has become available
             this.calendar.setupAuthentication(this.changeLogListener);
             return;
         }
 
         let batchSize = Preferences.get("calendar.caldav.multigetBatchSize", 100);
         let hrefString = "";
         while (this.itemsNeedFetching.length && batchSize > 0) {