Bug 1266184 - Implement nsIMIMEInputStream.data getter. r=mcmanus
authorGiorgio Maone <g.maone@informaction.com>
Wed, 20 Apr 2016 21:36:43 +0200
changeset 332584 cecb988dcacb3532adca881a93ef3fb0585f90f0
parent 332583 4965b4f209335d05855c813e772e5ec45ba2df0c
child 332585 35edab8d84dbe447525af059eb79f528cd2db24a
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1266184
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1266184 - Implement nsIMIMEInputStream.data getter. r=mcmanus MozReview-Commit-ID: EAfSPGDSZfW
netwerk/base/nsIMIMEInputStream.idl
netwerk/base/nsMIMEInputStream.cpp
--- a/netwerk/base/nsIMIMEInputStream.idl
+++ b/netwerk/base/nsIMIMEInputStream.idl
@@ -34,9 +34,14 @@ interface nsIMIMEInputStream : nsIInputS
      * Sets data-stream. May not be called once the stream has been started
      * to be read.
      * The cursor of the new stream should be located at the beginning of the
      * stream if the implementation of the nsIMIMEInputStream also is used as
      * an nsISeekableStream.
      * @param stream  stream containing the data for the stream
      */
     void setData(in nsIInputStream stream);
+
+    /**
+     * Get the wrapped data stream
+     */
+    readonly attribute nsIInputStream data;
 };
--- a/netwerk/base/nsMIMEInputStream.cpp
+++ b/netwerk/base/nsMIMEInputStream.cpp
@@ -154,16 +154,25 @@ nsMIMEInputStream::SetData(nsIInputStrea
         mStream->RemoveStream(2);
 
     mData = aStream;
     if (aStream)
         mStream->AppendStream(mData);
     return NS_OK;
 }
 
+NS_IMETHODIMP
+nsMIMEInputStream::GetData(nsIInputStream **aStream)
+{
+  NS_ENSURE_ARG_POINTER(aStream);
+  *aStream = mData;
+  NS_IF_ADDREF(*aStream);
+  return NS_OK;
+}
+
 // set up the internal streams
 void nsMIMEInputStream::InitStreams()
 {
     NS_ASSERTION(!mStartedReading,
                  "Don't call initStreams twice without rewinding");
 
     mStartedReading = true;