Bug 790617 - Part 1 - setUploadStream can handle 64-bit length r=cbiesinger
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 19 Sep 2012 17:09:08 +0900
changeset 107573 df2fbeb72ca1c8a1d523f17604d11d6fbe9d61a0
parent 107572 3403a77db50568bb7c548f3a2a1c787ec7425a5a
child 107574 2d6537a4762764eef1fdcff8b0c31c4a5795b7fb
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewerscbiesinger
bugs790617
milestone18.0a1
Bug 790617 - Part 1 - setUploadStream can handle 64-bit length r=cbiesinger
netwerk/base/public/nsIUploadChannel.idl
netwerk/protocol/file/nsFileChannel.cpp
netwerk/protocol/ftp/FTPChannelChild.cpp
netwerk/protocol/ftp/nsFTPChannel.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
--- a/netwerk/base/public/nsIUploadChannel.idl
+++ b/netwerk/base/public/nsIUploadChannel.idl
@@ -9,17 +9,17 @@ interface nsIInputStream;
 
 /**
  * nsIUploadChannel
  *
  * A channel may optionally implement this interface if it supports the
  * notion of uploading a data stream.  The upload stream may only be set
  * prior to the invocation of asyncOpen on the channel.
  */
-[scriptable, uuid(ddf633d8-e9a4-439d-ad88-de636fd9bb75)]
+[scriptable, uuid(5cfe15bd-5adb-4a7f-9e55-4f5a67d15794)]
 interface nsIUploadChannel : nsISupports
 {
     /**
      * Sets a stream to be uploaded by this channel.
      *
      * Most implementations of this interface require that the stream:
      *   (1) implement threadsafe addRef and release
      *   (2) implement nsIInputStream::readSegments
@@ -42,15 +42,15 @@ interface nsIUploadChannel : nsISupports
      *        replace any existing Content-Type header on the HTTP request.
      *        In the case of FTP and FILE, this parameter is ignored.
      * @param aContentLength
      *        A value of -1 indicates that the length of the stream should be
      *        determined by calling the stream's |available| method.
      */
     void setUploadStream(in nsIInputStream aStream,
                          in ACString aContentType,
-                         in long aContentLength);    
+                         in long long aContentLength);
 
     /**
      * Get the stream (to be) uploaded by this channel.
      */
     readonly attribute nsIInputStream uploadStream;
 };
--- a/netwerk/protocol/file/nsFileChannel.cpp
+++ b/netwerk/protocol/file/nsFileChannel.cpp
@@ -409,17 +409,17 @@ nsFileChannel::GetFile(nsIFile **file)
 }
 
 //-----------------------------------------------------------------------------
 // nsFileChannel::nsIUploadChannel
 
 NS_IMETHODIMP
 nsFileChannel::SetUploadStream(nsIInputStream *stream,
                                const nsACString &contentType,
-                               int32_t contentLength)
+                               int64_t contentLength)
 {
   NS_ENSURE_TRUE(!IsPending(), NS_ERROR_IN_PROGRESS);
 
   if ((mUploadStream = stream)) {
     mUploadLength = contentLength;
     if (mUploadLength < 0) {
       // Make sure we know how much data we are uploading.
       uint64_t avail;
--- a/netwerk/protocol/ftp/FTPChannelChild.cpp
+++ b/netwerk/protocol/ftp/FTPChannelChild.cpp
@@ -113,17 +113,17 @@ NS_IMETHODIMP
 FTPChannelChild::GetProxyInfo(nsIProxyInfo** aProxyInfo)
 {
   DROP_DEAD();
 }
 
 NS_IMETHODIMP
 FTPChannelChild::SetUploadStream(nsIInputStream* stream,
                                  const nsACString& contentType,
-                                 int32_t contentLength)
+                                 int64_t contentLength)
 {
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
   mUploadStream = stream;
   // NOTE: contentLength is intentionally ignored here.
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/netwerk/protocol/ftp/nsFTPChannel.cpp
+++ b/netwerk/protocol/ftp/nsFTPChannel.cpp
@@ -53,17 +53,17 @@ NS_IMPL_ISUPPORTS_INHERITED5(nsFtpChanne
                              nsIProxiedChannel,
                              nsIPrivateBrowsingChannel)
 
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsFtpChannel::SetUploadStream(nsIInputStream *stream,
                               const nsACString &contentType,
-                              int32_t contentLength)
+                              int64_t contentLength)
 {
     NS_ENSURE_TRUE(!IsPending(), NS_ERROR_IN_PROGRESS);
 
     mUploadStream = stream;
 
     // NOTE: contentLength is intentionally ignored here.
  
     return NS_OK;
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -436,17 +436,17 @@ HttpBaseChannel::GetUploadStream(nsIInpu
   *stream = mUploadStream;
   NS_IF_ADDREF(*stream);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpBaseChannel::SetUploadStream(nsIInputStream *stream,
                                const nsACString &contentType,
-                               int32_t contentLength)
+                               int64_t contentLength)
 {
   // NOTE: for backwards compatibility and for compatibility with old style
   // plugins, |stream| may include headers, specifically Content-Type and
   // Content-Length headers.  in this case, |contentType| and |contentLength|
   // would be unspecified.  this is traditionally the case of a POST request,
   // and so we select POST as the request method if contentType and
   // contentLength are unspecified.