bug 648878 - move get(local|remote)(address|port) to httpchannelchild r=jduell
authorNick Hurley <hurley@mozilla.com>
Thu, 05 May 2011 11:45:59 -0400
changeset 69122 adf273dbca3800e0ddbfd886fc033e5d07159fb8
parent 69121 b25f2bdf71ec53df3c1c6b2980318dec8c2385af
child 69123 6b26a933cad7b064249a211394767b4382c80ecd
push id99
push usereakhgari@mozilla.com
push dateTue, 24 May 2011 18:03:59 +0000
treeherdermozilla-aurora@26d6981b3d6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs648878
milestone6.0a1
bug 648878 - move get(local|remote)(address|port) to httpchannelchild r=jduell
netwerk/ipc/NeckoMessageUtils.h
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelChild.h
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/PHttpChannel.ipdl
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChannel.h
--- a/netwerk/ipc/NeckoMessageUtils.h
+++ b/netwerk/ipc/NeckoMessageUtils.h
@@ -42,16 +42,17 @@
 #include "IPC/IPCMessageUtils.h"
 #include "nsStringGlue.h"
 #include "nsIURI.h"
 #include "nsIIPCSerializable.h"
 #include "nsIClassInfo.h"
 #include "nsComponentManagerUtils.h"
 #include "nsNetUtil.h"
 #include "nsStringStream.h"
+#include "prio.h"
 
 namespace IPC {
 
 // Since IPDL doesn't have any knowledge of pointers, there's no easy way to
 // pass around nsIURI pointers.  This is a very thin wrapper that IPDL can
 // easily work with, allowing for conversion to and from an nsIURI pointer.
 
 class URI {
@@ -320,11 +321,69 @@ struct ParamTraits<Permission>
   }
 
   static void Log(const Permission& aParam, std::wstring* aLog)
   {
     aLog->append(StringPrintf(L"[%s]", aParam.host.get()));
   }
 };
 
+template<>
+struct ParamTraits<PRNetAddr>
+{
+  static void Write(Message* aMsg, const PRNetAddr &aParam)
+  {
+    WriteParam(aMsg, aParam.raw.family);
+    if (aParam.raw.family == PR_AF_UNSPEC) {
+      aMsg->WriteBytes(aParam.raw.data, sizeof(aParam.raw.data));
+    } else if (aParam.raw.family == PR_AF_INET) {
+      WriteParam(aMsg, aParam.inet.port);
+      WriteParam(aMsg, aParam.inet.ip);
+    } else if (aParam.raw.family == PR_AF_INET6) {
+      WriteParam(aMsg, aParam.ipv6.port);
+      WriteParam(aMsg, aParam.ipv6.flowinfo);
+      WriteParam(aMsg, aParam.ipv6.ip.pr_s6_addr64[0]);
+      WriteParam(aMsg, aParam.ipv6.ip.pr_s6_addr64[1]);
+      WriteParam(aMsg, aParam.ipv6.scope_id);
+#if defined(XP_UNIX) || defined(XP_OS2)
+    } else if (aParam.raw.family == PR_AF_LOCAL) {
+      aMsg->WriteBytes(aParam.local.path, sizeof(aParam.local.path));
+#endif
+    }
+
+    /* If we get here without hitting any of the cases above, there's not much
+     * we can do but let the deserializer fail when it gets this message */
+  }
+
+  static bool Read(const Message* aMsg, void** aIter, PRNetAddr* aResult)
+  {
+    if (!ReadParam(aMsg, aIter, &aResult->raw.family))
+      return false;
+
+    if (aResult->raw.family == PR_AF_UNSPEC) {
+      return aMsg->ReadBytes(aIter,
+                             reinterpret_cast<const char**>(&aResult->raw.data),
+                             sizeof(aResult->raw.data));
+    } else if (aResult->raw.family == PR_AF_INET) {
+      return ReadParam(aMsg, aIter, &aResult->inet.port) &&
+             ReadParam(aMsg, aIter, &aResult->inet.ip);
+    } else if (aResult->raw.family == PR_AF_INET6) {
+      return ReadParam(aMsg, aIter, &aResult->ipv6.port) &&
+             ReadParam(aMsg, aIter, &aResult->ipv6.flowinfo) &&
+             ReadParam(aMsg, aIter, &aResult->ipv6.ip.pr_s6_addr64[0]) &&
+             ReadParam(aMsg, aIter, &aResult->ipv6.ip.pr_s6_addr64[1]) &&
+             ReadParam(aMsg, aIter, &aResult->ipv6.scope_id);
+#if defined(XP_UNIX) || defined(XP_OS2)
+    } else if (aResult->raw.family == PR_AF_LOCAL) {
+      return aMsg->ReadBytes(aIter,
+                             reinterpret_cast<const char**>(&aResult->local.path),
+                             sizeof(aResult->local.path));
+#endif
+    }
+
+    /* We've been tricked by some socket family we don't know about! */
+    return false;
+  }
+};
+
 }
 
 #endif // mozilla_net_NeckoMessageUtils_h
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -49,16 +49,18 @@
 #include "nsICachingChannel.h"
 #include "nsISeekableStream.h"
 #include "nsIEncodedChannel.h"
 #include "nsIResumableChannel.h"
 #include "nsIApplicationCacheChannel.h"
 #include "nsEscape.h"
 #include "nsPrintfCString.h"
 
+#include "prnetdb.h"
+
 namespace mozilla {
 namespace net {
 
 HttpBaseChannel::HttpBaseChannel()
   : mStartPos(LL_MAXUINT)
   , mStatus(NS_OK)
   , mLoadFlags(LOAD_NORMAL)
   , mPriority(PRIORITY_NORMAL)
@@ -1172,16 +1174,76 @@ HttpBaseChannel::SetChannelIsForDownload
 
 NS_IMETHODIMP
 HttpBaseChannel::SetCacheKeysRedirectChain(nsTArray<nsCString> *cacheKeys)
 {
   mRedirectedCachekeys = cacheKeys;
   return NS_OK;
 }
 
+NS_IMETHODIMP
+HttpBaseChannel::GetLocalAddress(nsACString& addr)
+{
+  if (mSelfAddr.raw.family == PR_AF_UNSPEC)
+    return NS_ERROR_NOT_AVAILABLE;
+
+  addr.SetCapacity(64);
+  PR_NetAddrToString(&mSelfAddr, addr.BeginWriting(), 64);
+  addr.SetLength(strlen(addr.BeginReading()));
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HttpBaseChannel::GetLocalPort(PRInt32* port)
+{
+  NS_ENSURE_ARG_POINTER(port);
+
+  if (mSelfAddr.raw.family == PR_AF_INET) {
+    *port = (PRInt32)PR_ntohs(mSelfAddr.inet.port);
+  }
+  else if (mSelfAddr.raw.family == PR_AF_INET6) {
+    *port = (PRInt32)PR_ntohs(mSelfAddr.ipv6.port);
+  }
+  else
+    return NS_ERROR_NOT_AVAILABLE;
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HttpBaseChannel::GetRemoteAddress(nsACString& addr)
+{
+  if (mPeerAddr.raw.family == PR_AF_UNSPEC)
+    return NS_ERROR_NOT_AVAILABLE;
+
+  addr.SetCapacity(64);
+  PR_NetAddrToString(&mPeerAddr, addr.BeginWriting(), 64);
+  addr.SetLength(strlen(addr.BeginReading()));
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HttpBaseChannel::GetRemotePort(PRInt32* port)
+{
+  NS_ENSURE_ARG_POINTER(port);
+
+  if (mPeerAddr.raw.family == PR_AF_INET) {
+    *port = (PRInt32)PR_ntohs(mPeerAddr.inet.port);
+  }
+  else if (mPeerAddr.raw.family == PR_AF_INET6) {
+    *port = (PRInt32)PR_ntohs(mPeerAddr.ipv6.port);
+  }
+  else
+    return NS_ERROR_NOT_AVAILABLE;
+
+  return NS_OK;
+}
+
 //-----------------------------------------------------------------------------
 // HttpBaseChannel::nsISupportsPriority
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpBaseChannel::GetPriority(PRInt32 *value)
 {
   *value = mPriority;
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -150,16 +150,20 @@ public:
   NS_IMETHOD GetResponseVersion(PRUint32 *major, PRUint32 *minor);
   NS_IMETHOD SetCookie(const char *aCookieHeader);
   NS_IMETHOD GetForceAllowThirdPartyCookie(PRBool *aForce);
   NS_IMETHOD SetForceAllowThirdPartyCookie(PRBool aForce);
   NS_IMETHOD GetCanceled(PRBool *aCanceled);
   NS_IMETHOD GetChannelIsForDownload(PRBool *aChannelIsForDownload);
   NS_IMETHOD SetChannelIsForDownload(PRBool aChannelIsForDownload);
   NS_IMETHOD SetCacheKeysRedirectChain(nsTArray<nsCString> *cacheKeys);
+  NS_IMETHOD GetLocalAddress(nsACString& addr);
+  NS_IMETHOD GetLocalPort(PRInt32* port);
+  NS_IMETHOD GetRemoteAddress(nsACString& addr);
+  NS_IMETHOD GetRemotePort(PRInt32* port);
   inline void CleanRedirectCacheChainIfNecessary()
   {
       if (mRedirectedCachekeys) {
           delete mRedirectedCachekeys;
           mRedirectedCachekeys = nsnull;
       }
   }
 
@@ -192,16 +196,19 @@ public:
         nsCOMPtr<nsIHttpChannel> mChannel;
         
         PRPackedBool mReady;
     };
 
     nsHttpResponseHead * GetResponseHead() const { return mResponseHead; }
     nsHttpRequestHead * GetRequestHead() { return &mRequestHead; }
 
+    const PRNetAddr& GetSelfAddr() { return mSelfAddr; }
+    const PRNetAddr& GetPeerAddr() { return mPeerAddr; }
+
 protected:
   nsresult ApplyContentConversions();
 
   void AddCookiesToRequest();
   virtual nsresult SetupReplacementChannel(nsIURI *,
                                            nsIChannel *,
                                            PRBool preserveMethod);
 
@@ -231,16 +238,19 @@ protected:
   nsAutoPtr<nsHttpResponseHead>     mResponseHead;
   nsRefPtr<nsHttpConnectionInfo>    mConnectionInfo;
 
   nsCString                         mSpec; // ASCII encoded URL spec
   nsCString                         mContentTypeHint;
   nsCString                         mContentCharsetHint;
   nsCString                         mUserSetCookieHeader;
 
+  PRNetAddr                         mSelfAddr;
+  PRNetAddr                         mPeerAddr;
+
   // Resumable channel specific data
   nsCString                         mEntityID;
   PRUint64                          mStartPos;
 
   nsresult                          mStatus;
   PRUint32                          mLoadFlags;
   PRInt16                           mPriority;
   PRUint8                           mCaps;
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -150,45 +150,51 @@ class StartRequestEvent : public Channel
   StartRequestEvent(HttpChannelChild* child,
                     const nsHttpResponseHead& responseHead,
                     const PRBool& useResponseHead,
                     const RequestHeaderTuples& requestHeaders,
                     const PRBool& isFromCache,
                     const PRBool& cacheEntryAvailable,
                     const PRUint32& cacheExpirationTime,
                     const nsCString& cachedCharset,
-                    const nsCString& securityInfoSerialization)
+                    const nsCString& securityInfoSerialization,
+                    const PRNetAddr& selfAddr,
+                    const PRNetAddr& peerAddr)
   : mChild(child)
   , mResponseHead(responseHead)
   , mRequestHeaders(requestHeaders)
   , mUseResponseHead(useResponseHead)
   , mIsFromCache(isFromCache)
   , mCacheEntryAvailable(cacheEntryAvailable)
   , mCacheExpirationTime(cacheExpirationTime)
   , mCachedCharset(cachedCharset)
   , mSecurityInfoSerialization(securityInfoSerialization)
+  , mSelfAddr(selfAddr)
+  , mPeerAddr(peerAddr)
   {}
 
   void Run() 
   { 
     mChild->OnStartRequest(mResponseHead, mUseResponseHead, mRequestHeaders,
                            mIsFromCache, mCacheEntryAvailable,
                            mCacheExpirationTime, mCachedCharset,
-                           mSecurityInfoSerialization);
+                           mSecurityInfoSerialization, mSelfAddr, mPeerAddr);
   }
  private:
   HttpChannelChild* mChild;
   nsHttpResponseHead mResponseHead;
   RequestHeaderTuples mRequestHeaders;
   PRPackedBool mUseResponseHead;
   PRPackedBool mIsFromCache;
   PRPackedBool mCacheEntryAvailable;
   PRUint32 mCacheExpirationTime;
   nsCString mCachedCharset;
   nsCString mSecurityInfoSerialization;
+  PRNetAddr mSelfAddr;
+  PRNetAddr mPeerAddr;
 };
 
 bool
 HttpChannelChild::RecvAssociateApplicationCache(const nsCString &groupID,
                                                 const nsCString &clientID)
 {
   nsresult rv;
   mApplicationCache = do_CreateInstance(
@@ -204,41 +210,46 @@ HttpChannelChild::RecvAssociateApplicati
 bool 
 HttpChannelChild::RecvOnStartRequest(const nsHttpResponseHead& responseHead,
                                      const PRBool& useResponseHead,
                                      const RequestHeaderTuples& requestHeaders,
                                      const PRBool& isFromCache,
                                      const PRBool& cacheEntryAvailable,
                                      const PRUint32& cacheExpirationTime,
                                      const nsCString& cachedCharset,
-                                     const nsCString& securityInfoSerialization)
+                                     const nsCString& securityInfoSerialization,
+                                     const PRNetAddr& selfAddr,
+                                     const PRNetAddr& peerAddr)
 {
   if (ShouldEnqueue()) {
     EnqueueEvent(new StartRequestEvent(this, responseHead, useResponseHead,
                                        requestHeaders,
                                        isFromCache, cacheEntryAvailable,
                                        cacheExpirationTime, cachedCharset,
-                                       securityInfoSerialization));
+                                       securityInfoSerialization, selfAddr,
+                                       peerAddr));
   } else {
     OnStartRequest(responseHead, useResponseHead, requestHeaders, isFromCache,
                    cacheEntryAvailable, cacheExpirationTime, cachedCharset,
-                   securityInfoSerialization);
+                   securityInfoSerialization, selfAddr, peerAddr);
   }
   return true;
 }
 
 void 
 HttpChannelChild::OnStartRequest(const nsHttpResponseHead& responseHead,
                                  const PRBool& useResponseHead,
                                  const RequestHeaderTuples& requestHeaders,
                                  const PRBool& isFromCache,
                                  const PRBool& cacheEntryAvailable,
                                  const PRUint32& cacheExpirationTime,
                                  const nsCString& cachedCharset,
-                                 const nsCString& securityInfoSerialization)
+                                 const nsCString& securityInfoSerialization,
+                                 const PRNetAddr& selfAddr,
+                                 const PRNetAddr& peerAddr)
 {
   LOG(("HttpChannelChild::RecvOnStartRequest [this=%x]\n", this));
 
   if (useResponseHead && !mCanceled)
     mResponseHead = new nsHttpResponseHead(responseHead);
 
   if (!securityInfoSerialization.IsEmpty()) {
     NS_DeserializeObject(securityInfoSerialization, 
@@ -266,16 +277,19 @@ HttpChannelChild::OnStartRequest(const n
   }
 
   if (mResponseHead)
     SetCookie(mResponseHead->PeekHeader(nsHttp::Set_Cookie));
 
   rv = ApplyContentConversions();
   if (NS_FAILED(rv))
     Cancel(rv);
+
+  mSelfAddr = selfAddr;
+  mPeerAddr = peerAddr;
 }
 
 class TransportAndDataEvent : public ChannelEvent
 {
  public:
   TransportAndDataEvent(HttpChannelChild* child,
                         const nsresult& status,
                         const PRUint64& progress,
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -129,17 +129,19 @@ public:
 protected:
   bool RecvOnStartRequest(const nsHttpResponseHead& responseHead,
                           const PRBool& useResponseHead,
                           const RequestHeaderTuples& requestHeaders,
                           const PRBool& isFromCache,
                           const PRBool& cacheEntryAvailable,
                           const PRUint32& cacheExpirationTime,
                           const nsCString& cachedCharset,
-                          const nsCString& securityInfoSerialization);
+                          const nsCString& securityInfoSerialization,
+                          const PRNetAddr& selfAddr,
+                          const PRNetAddr& peerAddr);
   bool RecvOnTransportAndData(const nsresult& status,
                               const PRUint64& progress,
                               const PRUint64& progressMax,
                               const nsCString& data,
                               const PRUint32& offset,
                               const PRUint32& count);
   bool RecvOnStopRequest(const nsresult& statusCode);
   bool RecvOnProgress(const PRUint64& progress, const PRUint64& progressMax);
@@ -177,17 +179,19 @@ private:
 
   void OnStartRequest(const nsHttpResponseHead& responseHead,
                       const PRBool& useResponseHead,
                       const RequestHeaderTuples& requestHeaders,
                       const PRBool& isFromCache,
                       const PRBool& cacheEntryAvailable,
                       const PRUint32& cacheExpirationTime,
                       const nsCString& cachedCharset,
-                      const nsCString& securityInfoSerialization);
+                      const nsCString& securityInfoSerialization,
+                      const PRNetAddr& selfAddr,
+                      const PRNetAddr& peerAddr);
   void OnTransportAndData(const nsresult& status,
                           const PRUint64 progress,
                           const PRUint64& progressMax,
                           const nsCString& data,
                           const PRUint32& offset,
                           const PRUint32& count);
   void OnStopRequest(const nsresult& statusCode);
   void OnProgress(const PRUint64& progress, const PRUint64& progressMax);
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -425,23 +425,25 @@ HttpChannelParent::OnStartRequest(nsIReq
 
   for (PRUint32 i = 0; i < harray.Count(); i++) {
     RequestHeaderTuple* tuple = headers.AppendElement();
     tuple->mHeader = harray.Headers()[i].header;
     tuple->mValue  = harray.Headers()[i].value;
     tuple->mMerge  = false;
   }
 
+  nsHttpChannel *httpChan = static_cast<nsHttpChannel *>(mChannel.get());
   if (mIPCClosed || 
       !SendOnStartRequest(responseHead ? *responseHead : nsHttpResponseHead(), 
                           !!responseHead,
                           headers,
                           isFromCache,
                           mCacheDescriptor ? PR_TRUE : PR_FALSE,
-                          expirationTime, cachedCharset, secInfoSerialization)) 
+                          expirationTime, cachedCharset, secInfoSerialization,
+                          httpChan->GetSelfAddr(), httpChan->GetPeerAddr())) 
   {
     return NS_ERROR_UNEXPECTED; 
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpChannelParent::OnStopRequest(nsIRequest *aRequest, 
--- a/netwerk/protocol/http/PHttpChannel.ipdl
+++ b/netwerk/protocol/http/PHttpChannel.ipdl
@@ -38,22 +38,24 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 include protocol PNecko;
 
 include "mozilla/net/PHttpChannelParams.h";
 include "mozilla/net/NeckoMessageUtils.h";
+include "prio.h";
 
 using RequestHeaderTuples;
 using nsHttpResponseHead;
 using nsHttpAtom;
 using IPC::URI;
 using IPC::InputStream;
+using PRNetAddr;
 
 namespace mozilla {
 namespace net {
 
 //-------------------------------------------------------------------
 protocol PHttpChannel
 {
   manager PNecko;
@@ -126,17 +128,19 @@ parent:
 child:
   OnStartRequest(nsHttpResponseHead  responseHead,
                  PRBool              useResponseHead,
                  RequestHeaderTuples requestHeaders,
                  PRBool              isFromCache,
                  PRBool              cacheEntryAvailable,
                  PRUint32            cacheExpirationTime,
                  nsCString           cachedCharset,
-                 nsCString           securityInfoSerialization);
+                 nsCString           securityInfoSerialization,
+                 PRNetAddr           selfAddr,
+                 PRNetAddr           peerAddr);
 
   // Combines a single OnDataAvailable and its associated OnProgress &
   // OnStatus calls into one IPDL message
   OnTransportAndData(nsresult  status,
                      PRUint64  progress,
                      PRUint64  progressMax,
                      nsCString data,
                      PRUint32  offset,
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -3709,76 +3709,16 @@ nsHttpChannel::SetupFallbackChannel(cons
     LOG(("nsHttpChannel::SetupFallbackChannel [this=%x, key=%s]",
          this, aFallbackKey));
     mFallbackChannel = PR_TRUE;
     mFallbackKey = aFallbackKey;
 
     return NS_OK;
 }
 
-NS_IMETHODIMP
-nsHttpChannel::GetRemoteAddress(nsACString & _result)
-{
-    if (mPeerAddr.raw.family == PR_AF_UNSPEC)
-        return NS_ERROR_NOT_AVAILABLE;
-
-    _result.SetCapacity(64);
-    PR_NetAddrToString(&mPeerAddr, _result.BeginWriting(), 64);
-    _result.SetLength(strlen(_result.BeginReading()));
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHttpChannel::GetRemotePort(PRInt32 * _result)
-{
-    NS_ENSURE_ARG_POINTER(_result);
-
-    if (mPeerAddr.raw.family == PR_AF_INET) {
-        *_result = (PRInt32)PR_ntohs(mPeerAddr.inet.port);
-    }
-    else if (mPeerAddr.raw.family == PR_AF_INET6) {
-        *_result = (PRInt32)PR_ntohs(mPeerAddr.ipv6.port);
-    }
-    else
-        return NS_ERROR_NOT_AVAILABLE;
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHttpChannel::GetLocalAddress(nsACString & _result)
-{
-    if (mSelfAddr.raw.family == PR_AF_UNSPEC)
-        return NS_ERROR_NOT_AVAILABLE;
-
-    _result.SetCapacity(64);
-    PR_NetAddrToString(&mSelfAddr, _result.BeginWriting(), 64);
-    _result.SetLength(strlen(_result.BeginReading()));
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHttpChannel::GetLocalPort(PRInt32 * _result)
-{
-    NS_ENSURE_ARG_POINTER(_result);
-
-    if (mSelfAddr.raw.family == PR_AF_INET) {
-        *_result = (PRInt32)PR_ntohs(mSelfAddr.inet.port);
-    }
-    else if (mSelfAddr.raw.family == PR_AF_INET6) {
-        *_result = (PRInt32)PR_ntohs(mSelfAddr.ipv6.port);
-    }
-    else
-        return NS_ERROR_NOT_AVAILABLE;
-
-    return NS_OK;
-}
-
 //-----------------------------------------------------------------------------
 // nsHttpChannel::nsISupportsPriority
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsHttpChannel::SetPriority(PRInt32 value)
 {
     PRInt16 newValue = NS_CLAMP(value, PR_INT16_MIN, PR_INT16_MAX);
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -132,20 +132,16 @@ public:
     NS_IMETHOD Cancel(nsresult status);
     NS_IMETHOD Suspend();
     NS_IMETHOD Resume();
     // nsIChannel
     NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo);
     NS_IMETHOD AsyncOpen(nsIStreamListener *listener, nsISupports *aContext);
     // nsIHttpChannelInternal
     NS_IMETHOD SetupFallbackChannel(const char *aFallbackKey);
-    NS_IMETHOD GetLocalAddress(nsACString& addr);
-    NS_IMETHOD GetLocalPort(PRInt32* port);
-    NS_IMETHOD GetRemoteAddress(nsACString& addr);
-    NS_IMETHOD GetRemotePort(PRInt32* port);
     // nsISupportsPriority
     NS_IMETHOD SetPriority(PRInt32 value);
     // nsIResumableChannel
     NS_IMETHOD ResumeAt(PRUint64 startPos, const nsACString& entityID);
 
 public: /* internal necko use only */ 
     typedef void (nsHttpChannel:: *nsAsyncCallback)(void);
 
@@ -346,19 +342,16 @@ private:
     // and also we want to pass possible 304 code response through.
     PRUint32                          mCustomConditionalRequest : 1;
     PRUint32                          mFallingBack              : 1;
     PRUint32                          mWaitingForRedirectCallback : 1;
     // True if mRequestTime has been set. In such a case it is safe to update
     // the cache entry's expiration time. Otherwise, it is not(see bug 567360).
     PRUint32                          mRequestTimeInitialized : 1;
 
-    PRNetAddr                         mSelfAddr;
-    PRNetAddr                         mPeerAddr;
-
     nsTArray<nsContinueRedirectionFunc> mRedirectFuncStack;
 
     nsCOMPtr<nsICryptoHash>        mHasher;
 
     nsresult WaitForRedirectCallback();
     void PushRedirectAsyncFunc(nsContinueRedirectionFunc func);
     void PopRedirectAsyncFunc(nsContinueRedirectionFunc func);
 };