Bug 1928997: Update tabs icon in Unified Search popup r=desktop-theme-reviewers,daleh...
[gecko.git] / security / manager / ssl / nsSSLSocketProvider.cpp
blob41fa50add8d1e5815ac90d1071f0950c9bec5415
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/BasePrincipal.h"
8 #include "nsSSLSocketProvider.h"
9 #include "nsNSSIOLayer.h"
10 #include "nsError.h"
12 using mozilla::OriginAttributes;
14 nsSSLSocketProvider::nsSSLSocketProvider() = default;
16 nsSSLSocketProvider::~nsSSLSocketProvider() = default;
18 NS_IMPL_ISUPPORTS(nsSSLSocketProvider, nsISocketProvider)
20 NS_IMETHODIMP
21 nsSSLSocketProvider::NewSocket(int32_t family, const char* host, int32_t port,
22 nsIProxyInfo* proxy,
23 const OriginAttributes& originAttributes,
24 uint32_t flags, uint32_t tlsFlags,
25 PRFileDesc** _result,
26 nsITLSSocketControl** tlsSocketControl) {
27 nsresult rv =
28 nsSSLIOLayerNewSocket(family, host, port, proxy, originAttributes,
29 _result, tlsSocketControl, false, flags, tlsFlags);
30 return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
33 // Add the SSL IO layer to an existing socket
34 NS_IMETHODIMP
35 nsSSLSocketProvider::AddToSocket(int32_t family, const char* host, int32_t port,
36 nsIProxyInfo* proxy,
37 const OriginAttributes& originAttributes,
38 uint32_t flags, uint32_t tlsFlags,
39 PRFileDesc* aSocket,
40 nsITLSSocketControl** tlsSocketControl) {
41 nsresult rv = nsSSLIOLayerAddToSocket(
42 family, host, port, proxy, originAttributes, aSocket, tlsSocketControl,
43 false, flags, tlsFlags);
45 return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;