netwerk/socket/nsSocketProviderService.cpp

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsString.h"
     7 #include "nsIServiceManager.h"
     8 #include "nsISocketProvider.h"
     9 #include "nsSocketProviderService.h"
    10 #include "nsError.h"
    12 ////////////////////////////////////////////////////////////////////////////////
    14 nsresult
    15 nsSocketProviderService::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
    16 {
    17   nsresult rv;
    18   nsCOMPtr<nsISocketProviderService> inst = new nsSocketProviderService();
    19   if (!inst)
    20     rv = NS_ERROR_OUT_OF_MEMORY;
    21   else
    22     rv = inst->QueryInterface(aIID, aResult);
    23   return rv;
    24 }
    26 NS_IMPL_ISUPPORTS(nsSocketProviderService, nsISocketProviderService)
    28 ////////////////////////////////////////////////////////////////////////////////
    30 NS_IMETHODIMP
    31 nsSocketProviderService::GetSocketProvider(const char         *type,
    32                                            nsISocketProvider **result)
    33 {
    34   nsresult rv;
    35   nsAutoCString contractID(
    36           NS_LITERAL_CSTRING(NS_NETWORK_SOCKET_CONTRACTID_PREFIX) +
    37           nsDependentCString(type));
    39   rv = CallGetService(contractID.get(), result);
    40   if (NS_FAILED(rv)) 
    41       rv = NS_ERROR_UNKNOWN_SOCKET_TYPE;
    42   return rv;
    43 }
    45 ////////////////////////////////////////////////////////////////////////////////

mercurial