Bug 1312314 - Remove m_originalUrl from NNTP and use m_url instead. r=alta88, rs=rkent a=jorgk
authorJorg K
Fri, 28 Oct 2016 20:22:18 +0200
changeset 27630 d3dc37a155de205e8221477cf29d0065f5831429
parent 27629 3a2c0f8c8896daf9e9a7ab9fd23eea1c9583ec13
child 27631 efc0b0e02b689aeb9a73369b3773055edc370dcc
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersalta88, rkent, jorgk
bugs1312314
Bug 1312314 - Remove m_originalUrl from NNTP and use m_url instead. r=alta88, rs=rkent a=jorgk
mailnews/news/src/nsNNTPProtocol.cpp
mailnews/news/src/nsNntpMockChannel.cpp
mailnews/news/src/nsNntpMockChannel.h
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -632,17 +632,16 @@ nsNntpCacheStreamListener::OnDataAvailab
     NS_ENSURE_STATE(mListener);
     nsCOMPtr <nsIRequest> ourRequest = do_QueryInterface(mChannelToUse);
     return mListener->OnDataAvailable(ourRequest, aCtxt, aInStream, aSourceOffset, aCount);
 }
 
 NS_IMETHODIMP nsNNTPProtocol::GetOriginalURI(nsIURI* *aURI)
 {
     // News does not seem to have the notion of an original URI (See Bug #193317)
-    // *aURI = m_originalUrl ? m_originalUrl : m_url;
     *aURI = m_url;
     NS_IF_ADDREF(*aURI);
     return NS_OK;
 }
 
 NS_IMETHODIMP nsNNTPProtocol::SetOriginalURI(nsIURI* aURI)
 {
     // News does not seem to have the notion of an original URI (See Bug #193317)
--- a/mailnews/news/src/nsNntpMockChannel.cpp
+++ b/mailnews/news/src/nsNntpMockChannel.cpp
@@ -134,24 +134,25 @@ NS_IMETHODIMP nsNntpMockChannel::SetLoad
 
 ////////////////////////
 // nsIChannel methods //
 ////////////////////////
 
 NS_IMETHODIMP nsNntpMockChannel::GetOriginalURI(nsIURI **aURI)
 {
   FORWARD_CALL(GetOriginalURI, aURI)
-  NS_IF_ADDREF(*aURI = m_originalUrl);
+  NS_IF_ADDREF(*aURI = m_url);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsNntpMockChannel::SetOriginalURI(nsIURI *aURI)
 {
   FORWARD_CALL(SetOriginalURI, aURI)
-  m_originalUrl = aURI;
+  // News does not seem to have the notion of an original URI.
+  // (See bug 193317 and bug 1312314.)
   return NS_OK;
 }
 
 NS_IMETHODIMP nsNntpMockChannel::GetURI(nsIURI **aURI)
 {
   NS_IF_ADDREF(*aURI = m_url);
   return NS_OK;
 }
@@ -311,17 +312,16 @@ nsNntpMockChannel::AttachNNTPConnection(
   // protocol instance. We also need to initialize it. For best results, we're
   // going to initialize the code and then set the values.
   nsresult rv = protocol.Initialize(m_url, m_msgWindow);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Variable fun
   protocol.SetLoadGroup(m_loadGroup);
   protocol.SetLoadFlags(m_loadFlags);
-  protocol.SetOriginalURI(m_originalUrl);
   protocol.SetOwner(m_owner);
   protocol.SetNotificationCallbacks(m_notificationCallbacks);
   protocol.SetContentType(m_contentType);
 
   // Now that we've set up the protocol, attach it to ourselves so that we can
   // forward all future calls to the protocol instance. We do not refcount this
   // instance, since the server will be owning all of them: once the server
   // releases its reference, the protocol instance is no longer usable anyways.
--- a/mailnews/news/src/nsNntpMockChannel.h
+++ b/mailnews/news/src/nsNntpMockChannel.h
@@ -50,17 +50,16 @@ protected:
   nsNNTPProtocol *m_protocol;
 
   // Temporary variables for accessors before we get to the actual instance.
   nsresult m_cancelStatus;
   nsCOMPtr<nsILoadGroup> m_loadGroup;
   nsCOMPtr<nsILoadInfo> m_loadInfo;
   nsLoadFlags m_loadFlags;
 
-  nsCOMPtr<nsIURI> m_originalUrl;
   nsCOMPtr<nsISupports> m_owner;
   nsCOMPtr<nsIInterfaceRequestor> m_notificationCallbacks;
   nsCString m_contentType;
   nsCString m_contentCharset;
   int64_t m_contentLength;
 };
 
 #endif  // nsNntpMockChannel_h___