Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
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/. */
6 :
7 : #include "mozilla/BasePrincipal.h"
8 : #include "nsSSLSocketProvider.h"
9 : #include "nsNSSIOLayer.h"
10 : #include "nsError.h"
11 :
12 : using mozilla::OriginAttributes;
13 :
14 0 : nsSSLSocketProvider::nsSSLSocketProvider()
15 : {
16 0 : }
17 :
18 0 : nsSSLSocketProvider::~nsSSLSocketProvider()
19 : {
20 0 : }
21 :
22 0 : NS_IMPL_ISUPPORTS(nsSSLSocketProvider, nsISocketProvider)
23 :
24 : NS_IMETHODIMP
25 0 : nsSSLSocketProvider::NewSocket(int32_t family,
26 : const char *host,
27 : int32_t port,
28 : nsIProxyInfo *proxy,
29 : const OriginAttributes &originAttributes,
30 : uint32_t flags,
31 : PRFileDesc **_result,
32 : nsISupports **securityInfo)
33 : {
34 : nsresult rv = nsSSLIOLayerNewSocket(family,
35 : host,
36 : port,
37 : proxy,
38 : originAttributes,
39 : _result,
40 : securityInfo,
41 : false,
42 0 : flags);
43 0 : return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
44 : }
45 :
46 : // Add the SSL IO layer to an existing socket
47 : NS_IMETHODIMP
48 0 : nsSSLSocketProvider::AddToSocket(int32_t family,
49 : const char *host,
50 : int32_t port,
51 : nsIProxyInfo *proxy,
52 : const OriginAttributes &originAttributes,
53 : uint32_t flags,
54 : PRFileDesc *aSocket,
55 : nsISupports **securityInfo)
56 : {
57 : nsresult rv = nsSSLIOLayerAddToSocket(family,
58 : host,
59 : port,
60 : proxy,
61 : originAttributes,
62 : aSocket,
63 : securityInfo,
64 : false,
65 0 : flags);
66 :
67 0 : return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
68 : }
|