mozilla-webprogress.patch
author Makoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 24 Oct 2012 11:59:46 +0900
changeset 14665 e59d39d28c408aa1e23b9941807a15f17d5857cb
permissions -rw-r--r--
try: -b do -p all -u all -t none

# HG changeset patch
# Parent cb0c2eab4492457d49c02d2bfd8f1ed3c40b720e

diff --git a/mail/base/content/specialTabs.js b/mail/base/content/specialTabs.js
--- a/mail/base/content/specialTabs.js
+++ b/mail/base/content/specialTabs.js
@@ -38,26 +38,16 @@ tabProgressListener.prototype =
                                                   aMaxSelfProgress,
                                                   aCurTotalProgress,
                                                   aMaxTotalProgress) {
     if (this.mProgressListener)
       this.mProgressListener.onProgressChange(aWebProgress, aRequest,
         aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress,
         aMaxTotalProgress);
   },
-  onProgressChange64: function tPL_onProgressChange64(aWebProgress, aRequest,
-                                                      aCurSelfProgress,
-                                                      aMaxSelfProgress,
-                                                      aCurTotalProgress,
-                                                      aMaxTotalProgress) {
-    if (this.mProgressListener)
-      this.mProgressListener.onProgressChange64(aWebProgress, aRequest,
-        aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress,
-        aMaxTotalProgress);
-  },
   onLocationChange: function tPL_onLocationChange(aWebProgress, aRequest,
                                                   aLocationURI, aFlags) {
     if (this.mProgressListener)
       this.mProgressListener.onLocationChange(aWebProgress, aRequest,
         aLocationURI, aFlags);
     // onLocationChange is called for both the top-level content
     // and the subframes.
     if (aWebProgress.DOMWindow == this.mBrowser.contentWindow) {
diff --git a/mailnews/base/src/nsMessenger.cpp b/mailnews/base/src/nsMessenger.cpp
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -1868,17 +1868,17 @@ nsSaveMsgListener::OnStopRequest(nsIRequ
 
       delete m_saveAllAttachmentsState;
       m_saveAllAttachmentsState = nullptr;
     }
   }
 
   if(mTransfer)
   {
-    mTransfer->OnProgressChange64(nullptr, nullptr, mMaxProgress, mMaxProgress, mMaxProgress, mMaxProgress);
+    mTransfer->OnProgressChange(nullptr, nullptr, mMaxProgress, mMaxProgress, mMaxProgress, mMaxProgress);
     mTransfer->OnStateChange(nullptr, nullptr, nsIWebProgressListener::STATE_STOP |
       nsIWebProgressListener::STATE_IS_NETWORK, NS_OK);
     mTransfer = nullptr; // break any circular dependencies between the progress dialog and use
   }
 
   if (mUrlHasStopped && mListener)
     mListener->OnStopRunningUrl(mListenerUri, rv);
 
@@ -1927,17 +1927,17 @@ nsSaveMsgListener::OnDataAvailable(nsIRe
         else
           rv = m_outputStream->Write(m_dataBuffer, readCount, &writeCount);
 
         available -= readCount;
       }
     }
 
     if (NS_SUCCEEDED(rv) && mTransfer) // Send progress notification.
-      mTransfer->OnProgressChange64(nullptr, request, mProgress, mMaxProgress, mProgress, mMaxProgress);
+      mTransfer->OnProgressChange(nullptr, request, mProgress, mMaxProgress, mProgress, mMaxProgress);
   }
   return rv;
 }
 
 #define MESSENGER_STRING_URL       "chrome://messenger/locale/messenger.properties"
 
 nsresult
 nsMessenger::InitStringBundle()
diff --git a/mailnews/base/src/nsMsgContentPolicy.cpp b/mailnews/base/src/nsMsgContentPolicy.cpp
--- a/mailnews/base/src/nsMsgContentPolicy.cpp
+++ b/mailnews/base/src/nsMsgContentPolicy.cpp
@@ -791,20 +791,20 @@ nsMsgContentPolicy::OnStateChange(nsIWeb
                                   nsresult aStatus)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgContentPolicy::OnProgressChange(nsIWebProgress *aWebProgress,
                                      nsIRequest *aRequest,
-                                     int32_t aCurSelfProgress,
-                                     int32_t aMaxSelfProgress,
-                                     int32_t aCurTotalProgress,
-                                     int32_t aMaxTotalProgress)
+                                     int64_t aCurSelfProgress,
+                                     int64_t aMaxSelfProgress,
+                                     int64_t aCurTotalProgress,
+                                     int64_t aMaxTotalProgress)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsMsgContentPolicy::OnLocationChange(nsIWebProgress *aWebProgress,
                                      nsIRequest *aRequest, nsIURI *aLocation,
                                      uint32_t aFlags)
diff --git a/mailnews/base/src/nsMsgPrintEngine.cpp b/mailnews/base/src/nsMsgPrintEngine.cpp
--- a/mailnews/base/src/nsMsgPrintEngine.cpp
+++ b/mailnews/base/src/nsMsgPrintEngine.cpp
@@ -168,20 +168,20 @@ nsMsgPrintEngine::OnStateChange(nsIWebPr
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgPrintEngine::OnProgressChange(nsIWebProgress *aWebProgress,
                                      nsIRequest *aRequest,
-                                     int32_t aCurSelfProgress,
-                                     int32_t aMaxSelfProgress,
-                                     int32_t aCurTotalProgress,
-                                     int32_t aMaxTotalProgress)
+                                     int64_t aCurSelfProgress,
+                                     int64_t aMaxSelfProgress,
+                                     int64_t aCurTotalProgress,
+                                     int64_t aMaxTotalProgress)
 {
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgPrintEngine::OnLocationChange(nsIWebProgress* aWebProgress,
                       nsIRequest* aRequest,
                       nsIURI *location,
diff --git a/mailnews/base/src/nsMsgProgress.cpp b/mailnews/base/src/nsMsgProgress.cpp
--- a/mailnews/base/src/nsMsgProgress.cpp
+++ b/mailnews/base/src/nsMsgProgress.cpp
@@ -152,18 +152,19 @@ NS_IMETHODIMP nsMsgProgress::OnStateChan
   }
 
   for (int32_t i = m_listenerList.Count() - 1; i >= 0; i --)
     m_listenerList[i]->OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus);
 
   return NS_OK;
 }
 
-/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
-NS_IMETHODIMP nsMsgProgress::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, int32_t aCurSelfProgress, int32_t aMaxSelfProgress, int32_t aCurTotalProgress, int32_t aMaxTotalProgress)
+/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long long aCurSelfProgress, in long long aMaxSelfProgress, in long long aCurTotalProgress, in long long aMaxTotalProgress); */
+NS_IMETHODIMP
+nsMsgProgress::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, int64_t aCurSelfProgress, int64_t aMaxSelfProgress, int64_t aCurTotalProgress, int64_t aMaxTotalProgress)
 {
   for (int32_t i = m_listenerList.Count() - 1; i >= 0; i --)
     m_listenerList[i]->OnProgressChange(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress);
   return NS_OK;
 }
 
 /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location, in unsigned long aFlags); */
 NS_IMETHODIMP nsMsgProgress::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location, uint32_t aFlags)
@@ -243,19 +244,19 @@ NS_IMETHODIMP nsMsgProgress::GetMsgWindo
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgProgress::OnProgress(nsIRequest *request, nsISupports* ctxt,
                                         uint64_t aProgress, uint64_t aProgressMax)
 {
   // XXX: What should the nsIWebProgress be?
-  // XXX: This truncates 64-bit to 32-bit
-  return OnProgressChange(nullptr, request, int32_t(aProgress), int32_t(aProgressMax),
-                          int32_t(aProgress) /* current total progress */, int32_t(aProgressMax) /* max total progress */);
+  return OnProgressChange(nullptr, request, aProgress, aProgressMax,
+                          aProgress /* current total progress */,
+                          aProgressMax /* max total progress */);
 }
 
 NS_IMETHODIMP nsMsgProgress::OnStatus(nsIRequest *request, nsISupports* ctxt,
                                       nsresult aStatus, const PRUnichar* aStatusArg)
 {
   nsresult rv;
   nsCOMPtr<nsIStringBundleService> sbs =
     mozilla::services::GetStringBundleService();
diff --git a/mailnews/base/src/nsMsgStatusFeedback.cpp b/mailnews/base/src/nsMsgStatusFeedback.cpp
--- a/mailnews/base/src/nsMsgStatusFeedback.cpp
+++ b/mailnews/base/src/nsMsgStatusFeedback.cpp
@@ -57,20 +57,20 @@ NS_INTERFACE_MAP_END
 
 //////////////////////////////////////////////////////////////////////////////////
 // nsMsgStatusFeedback::nsIWebProgressListener
 //////////////////////////////////////////////////////////////////////////////////
 
 NS_IMETHODIMP
 nsMsgStatusFeedback::OnProgressChange(nsIWebProgress* aWebProgress,
                                       nsIRequest* aRequest,
-                                      int32_t aCurSelfProgress,
-                                      int32_t aMaxSelfProgress, 
-                                      int32_t aCurTotalProgress,
-                                      int32_t aMaxTotalProgress)
+                                      int64_t aCurSelfProgress,
+                                      int64_t aMaxSelfProgress, 
+                                      int64_t aCurTotalProgress,
+                                      int64_t aMaxTotalProgress)
 {
   int32_t percentage = 0;
   if (aMaxTotalProgress > 0)
   {
     percentage =  (aCurTotalProgress * 100) / aMaxTotalProgress;
     if (percentage)
       ShowProgress(percentage);
   }
diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgCompose.cpp
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -3982,18 +3982,19 @@ NS_IMETHODIMP nsMsgComposeSendListener::
       msgCompose->GetMessageSend(getter_AddRefs(msgSend));
       if (msgSend)
         msgSend->Abort();
     }
   }
   return NS_OK;
 }
 
-/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
-NS_IMETHODIMP nsMsgComposeSendListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, int32_t aCurSelfProgress, int32_t aMaxSelfProgress, int32_t aCurTotalProgress, int32_t aMaxTotalProgress)
+/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long long aCurSelfProgress, in long long aMaxSelfProgress, in long long aCurTotalProgress, in long long aMaxTotalProgress); */
+NS_IMETHODIMP
+nsMsgComposeSendListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, int64_t aCurSelfProgress, int64_t aMaxSelfProgress, int64_t aCurTotalProgress, int64_t aMaxTotalProgress)
 {
   /* Ignore this call */
   return NS_OK;
 }
 
 /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location, in unsigned long aFlags); */
 NS_IMETHODIMP nsMsgComposeSendListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location, uint32_t aFlags)
 {
diff --git a/mailnews/compose/src/nsURLFetcher.cpp b/mailnews/compose/src/nsURLFetcher.cpp
--- a/mailnews/compose/src/nsURLFetcher.cpp
+++ b/mailnews/compose/src/nsURLFetcher.cpp
@@ -347,18 +347,20 @@ nsURLFetcher::InsertConverter(const char
 
   return rv;
 }
 
 // web progress listener implementation
 
 NS_IMETHODIMP
 nsURLFetcher::OnProgressChange(nsIWebProgress *aProgress, nsIRequest *aRequest,
-                             int32_t aCurSelfProgress, int32_t aMaxSelfProgress,
-                             int32_t aCurTotalProgress, int32_t aMaxTotalProgress)
+                               int64_t aCurSelfProgress,
+                               int64_t aMaxSelfProgress,
+                               int64_t aCurTotalProgress,
+                               int64_t aMaxTotalProgress)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsURLFetcher::OnStateChange(nsIWebProgress *aProgress, nsIRequest *aRequest,
                           uint32_t aStateFlags, nsresult aStatus)
 {
diff --git a/suite/browser/tabbrowser.xml b/suite/browser/tabbrowser.xml
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -421,24 +421,16 @@
               this.mMaxProgress = aMaxTotalProgress;
 
               this.mTabBrowser._callProgressListeners(this.mBrowser, "onProgressChange",
                                                       [aWebProgress, aRequest,
                                                       aCurSelfProgress, aMaxSelfProgress,
                                                       aCurTotalProgress, aMaxTotalProgress]);
             },
 
-            onProgressChange64: function (aWebProgress, aRequest,
-                                          aCurSelfProgress, aMaxSelfProgress,
-                                          aCurTotalProgress, aMaxTotalProgress) {
-              return this.onProgressChange(aWebProgress, aRequest,
-                aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress,
-                aMaxTotalProgress);
-            },
-
             onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus) {
               if (!aRequest)
                 return;
 
               var oldBlank = this.mBlank;
 
               const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
               const nsIChannel = Components.interfaces.nsIChannel;
diff --git a/suite/common/downloads/uploadProgress.js b/suite/common/downloads/uploadProgress.js
--- a/suite/common/downloads/uploadProgress.js
+++ b/suite/common/downloads/uploadProgress.js
@@ -83,24 +83,16 @@ var gProgressListener = {
       setTimeout(window.close, kInterval);
     }
   },
 
   // Handle progress notifications.
   onProgressChange: function(aWebProgress, aRequest,
                              aCurSelfProgress, aMaxSelfProgress,
                              aCurTotalProgress, aMaxTotalProgress) {
-    return this.onProgressChange64(aWebProgress, aRequest,
-                                   aCurSelfProgress, aMaxSelfProgress,
-                                   aCurTotalProgress, aMaxTotalProgress);
-  },
-
-  onProgressChange64: function(aWebProgress, aRequest,
-                               aCurSelfProgress, aMaxSelfProgress,
-                               aCurTotalProgress, aMaxTotalProgress) {
     if (aRequest instanceof Components.interfaces.nsIChannel &&
         aRequest.URI.equals(gTarget)) {
       // Get current time.
       var now = Date.now();
 
       // If interval hasn't elapsed, ignore it.
       if (!gStartTime)
         gStartTime = now;