Bug 1004149 - Remove some dead code. r=keeler
☠☠ backed out by 905d35af02ec ☠ ☠
authorCykesiopka <cykesiopka.bmo@gmail.com>
Thu, 17 Mar 2016 19:51:14 -0700
changeset 289382 f164ff25450e14362813120e1c21937d2f5b1012
parent 289381 5fe5459a786bee7180632dab6e53295646e18dcb
child 289383 7c6888880270b6108fa51dd63d4fa058a1df5741
push id30102
push userryanvm@gmail.com
push dateSat, 19 Mar 2016 15:23:17 +0000
treeherdermozilla-central@720fb3d55e28 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler
bugs1004149
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 1004149 - Remove some dead code. r=keeler MozReview-Commit-ID: JF6IgVCEUVe
security/manager/ssl/nsNSSCallbacks.cpp
security/manager/ssl/nsNSSCallbacks.h
security/manager/ssl/nsNSSComponent.cpp
--- a/security/manager/ssl/nsNSSCallbacks.cpp
+++ b/security/manager/ssl/nsNSSCallbacks.cpp
@@ -250,32 +250,16 @@ SECStatus nsNSSHttpRequestSession::setPo
 {
   mHasPostData = true;
   mPostData.Assign(http_data, http_data_len);
   mPostContentType.Assign(http_content_type);
 
   return SECSuccess;
 }
 
-SECStatus nsNSSHttpRequestSession::addHeaderFcn(const char *http_header_name, 
-                                                const char *http_header_value)
-{
-  return SECFailure; // not yet implemented
-
-  // All http code needs to be postponed to the UI thread.
-  // Once this gets implemented, we need to add a string list member to
-  // nsNSSHttpRequestSession and queue up the headers,
-  // so they can be added in HandleHTTPDownloadPLEvent.
-  //
-  // The header will need to be set using 
-  //   mHttpChannel->SetRequestHeader(nsDependentCString(http_header_name), 
-  //                                  nsDependentCString(http_header_value), 
-  //                                  false)));
-}
-
 SECStatus nsNSSHttpRequestSession::trySendAndReceiveFcn(PRPollDesc **pPollDesc,
                                                         uint16_t *http_response_code, 
                                                         const char **http_response_content_type, 
                                                         const char **http_response_headers, 
                                                         const char **http_response_data, 
                                                         uint32_t *http_response_data_len)
 {
   MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
@@ -542,59 +526,28 @@ nsNSSHttpRequestSession::internal_send_r
     if (mListener->mHttpResponseContentType.Length()) {
       *http_response_content_type = mListener->mHttpResponseContentType.get();
     }
   }
 
   return SECSuccess;
 }
 
-SECStatus nsNSSHttpRequestSession::cancelFcn()
-{
-  // As of today, only the blocking variant of the http interface
-  // has been implemented. Implementing cancelFcn will be necessary
-  // as soon as we implement the nonblocking variant.
-  return SECSuccess;
-}
-
-SECStatus nsNSSHttpRequestSession::freeFcn()
-{
-  Release();
-  return SECSuccess;
-}
-
 nsNSSHttpRequestSession::nsNSSHttpRequestSession()
 : mRefCount(1),
   mHasPostData(false),
   mTimeoutInterval(0),
   mListener(new nsHTTPListener)
 {
 }
 
 nsNSSHttpRequestSession::~nsNSSHttpRequestSession()
 {
 }
 
-SEC_HttpClientFcn nsNSSHttpInterface::sNSSInterfaceTable;
-
-void nsNSSHttpInterface::initTable()
-{
-  sNSSInterfaceTable.version = 1;
-  SEC_HttpClientFcnV1 &v1 = sNSSInterfaceTable.fcnTable.ftable1;
-  v1.createSessionFcn = createSessionFcn;
-  v1.keepAliveSessionFcn = keepAliveFcn;
-  v1.freeSessionFcn = freeSessionFcn;
-  v1.createFcn = createFcn;
-  v1.setPostDataFcn = setPostDataFcn;
-  v1.addHeaderFcn = addHeaderFcn;
-  v1.trySendAndReceiveFcn = trySendAndReceiveFcn;
-  v1.cancelFcn = cancelFcn;
-  v1.freeFcn = freeFcn;
-}
-
 nsHTTPListener::nsHTTPListener()
 : mResultData(nullptr),
   mResultLen(0),
   mLock("nsHTTPListener.mLock"),
   mCondition(mLock, "nsHTTPListener.mCondition"),
   mWaitFlag(true),
   mResponsibleForDoneSignal(false),
   mLoadGroup(nullptr),
--- a/security/manager/ssl/nsNSSCallbacks.h
+++ b/security/manager/ssl/nsNSSCallbacks.h
@@ -1,27 +1,28 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef _NSNSSCALLBACKS_H_
-#define _NSNSSCALLBACKS_H_
+#ifndef nsNSSCallbacks_h
+#define nsNSSCallbacks_h
 
+#include "mozilla/Attributes.h"
+#include "mozilla/CondVar.h"
+#include "mozilla/Mutex.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
-#include "pk11func.h"
+#include "nsIStreamLoader.h"
 #include "nspr.h"
-#include "ocspt.h"
-#include "nsIStreamLoader.h"
-#include "mozilla/CondVar.h"
-#include "mozilla/Mutex.h"
-#include "mozilla/Attributes.h"
 #include "nsString.h"
+#include "pk11func.h"
+
+#include "ocspt.h" // Must be included after pk11func.h.
 
 class nsILoadGroup;
 
 char*
 PK11PasswordPrompt(PK11SlotInfo *slot, PRBool retry, void* arg);
 
 void HandshakeCallback(PRFileDesc *fd, void *client_data);
 SECStatus CanFalseStartCallback(PRFileDesc* fd, void* client_data,
@@ -95,29 +96,23 @@ public:
                              const char *http_request_method, 
                              const PRIntervalTime timeout, 
                              SEC_HTTP_REQUEST_SESSION *pRequest);
 
   SECStatus setPostDataFcn(const char *http_data, 
                            const uint32_t http_data_len,
                            const char *http_content_type);
 
-  SECStatus addHeaderFcn(const char *http_header_name, 
-                         const char *http_header_value);
-
   SECStatus trySendAndReceiveFcn(PRPollDesc **pPollDesc,
                                  uint16_t *http_response_code, 
                                  const char **http_response_content_type, 
                                  const char **http_response_headers, 
                                  const char **http_response_data, 
                                  uint32_t *http_response_data_len);
 
-  SECStatus cancelFcn();
-  SECStatus freeFcn();
-
   void AddRef();
   void Release();
 
   nsCString mURL;
   nsCString mRequestMethod;
   
   bool mHasPostData;
   nsCString mPostData;
@@ -145,30 +140,16 @@ class nsNSSHttpInterface
 public:
   static SECStatus createSessionFcn(const char *host,
                                     uint16_t portnum,
                                     SEC_HTTP_SERVER_SESSION *pSession)
   {
     return nsNSSHttpServerSession::createSessionFcn(host, portnum, pSession);
   }
 
-  static SECStatus keepAliveFcn(SEC_HTTP_SERVER_SESSION session,
-                                PRPollDesc **pPollDesc)
-  {
-    // Not yet implemented, however, Necko does transparent keep-alive 
-    // anyway, when enabled in Necko's prefs.
-    return SECSuccess;
-  }
-
-  static SECStatus freeSessionFcn(SEC_HTTP_SERVER_SESSION session)
-  {
-    delete static_cast<nsNSSHttpServerSession*>(session);
-    return SECSuccess;
-  }
-
   static SECStatus createFcn(SEC_HTTP_SERVER_SESSION session,
                              const char *http_protocol_variant,
                              const char *path_and_query_string,
                              const char *http_request_method, 
                              const PRIntervalTime timeout, 
                              SEC_HTTP_REQUEST_SESSION *pRequest)
   {
     return nsNSSHttpRequestSession::createFcn(session, http_protocol_variant,
@@ -180,46 +161,23 @@ public:
                                   const char *http_data, 
                                   const uint32_t http_data_len,
                                   const char *http_content_type)
   {
     return static_cast<nsNSSHttpRequestSession*>(request)
             ->setPostDataFcn(http_data, http_data_len, http_content_type);
   }
 
-  static SECStatus addHeaderFcn(SEC_HTTP_REQUEST_SESSION request,
-                                const char *http_header_name, 
-                                const char *http_header_value)
-  {
-    return static_cast<nsNSSHttpRequestSession*>(request)
-            ->addHeaderFcn(http_header_name, http_header_value);
-  }
-
   static SECStatus trySendAndReceiveFcn(SEC_HTTP_REQUEST_SESSION request, 
                                         PRPollDesc **pPollDesc,
                                         uint16_t *http_response_code, 
                                         const char **http_response_content_type, 
                                         const char **http_response_headers, 
                                         const char **http_response_data, 
                                         uint32_t *http_response_data_len)
   {
     return static_cast<nsNSSHttpRequestSession*>(request)
             ->trySendAndReceiveFcn(pPollDesc, http_response_code, http_response_content_type, 
                      http_response_headers, http_response_data, http_response_data_len);
   }
-
-  static SECStatus cancelFcn(SEC_HTTP_REQUEST_SESSION request)
-  {
-    return static_cast<nsNSSHttpRequestSession*>(request)
-            ->cancelFcn();
-  }
-
-  static SECStatus freeFcn(SEC_HTTP_REQUEST_SESSION request)
-  {
-    return static_cast<nsNSSHttpRequestSession*>(request)
-            ->freeFcn();
-  }
-
-  static void initTable();
-  static SEC_HttpClientFcn sNSSInterfaceTable;
 };
 
-#endif // _NSNSSCALLBACKS_H_
+#endif // nsNSSCallbacks_h
--- a/security/manager/ssl/nsNSSComponent.cpp
+++ b/security/manager/ssl/nsNSSComponent.cpp
@@ -1098,18 +1098,16 @@ nsNSSComponent::InitializeNSS()
   nsCOMPtr<nsICertBlocklist> certList = do_GetService(NS_CERTBLOCKLIST_CONTRACTID);
   if (!certList) {
     return NS_ERROR_FAILURE;
   }
 
   // dynamic options from prefs
   setValidationOptions(true, lock);
 
-  mHttpForNSS.initTable();
-
 #ifndef MOZ_NO_SMART_CARDS
   LaunchSmartCardThreads();
 #endif
 
   mozilla::pkix::RegisterErrorTable();
 
   // Initialize the site security service
   nsCOMPtr<nsISiteSecurityService> sssService =