Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/security/manager/ssl/nsSSLSocketProvider.cpp
Line
Count
Source (jump to first uncovered line)
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
nsSSLSocketProvider::nsSSLSocketProvider()
15
0
{
16
0
}
17
18
nsSSLSocketProvider::~nsSSLSocketProvider()
19
0
{
20
0
}
21
22
NS_IMPL_ISUPPORTS(nsSSLSocketProvider, nsISocketProvider)
23
24
NS_IMETHODIMP
25
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
                               uint32_t tlsFlags,
32
                               PRFileDesc **_result,
33
                               nsISupports **securityInfo)
34
0
{
35
0
  nsresult rv = nsSSLIOLayerNewSocket(family,
36
0
                                      host,
37
0
                                      port,
38
0
                                      proxy,
39
0
                                      originAttributes,
40
0
                                      _result,
41
0
                                      securityInfo,
42
0
                                      false,
43
0
                                      flags,
44
0
                                      tlsFlags);
45
0
  return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
46
0
}
47
48
// Add the SSL IO layer to an existing socket
49
NS_IMETHODIMP
50
nsSSLSocketProvider::AddToSocket(int32_t family,
51
                                 const char *host,
52
                                 int32_t port,
53
                                 nsIProxyInfo *proxy,
54
                                 const OriginAttributes &originAttributes,
55
                                 uint32_t flags,
56
                                 uint32_t tlsFlags,
57
                                 PRFileDesc *aSocket,
58
                                 nsISupports **securityInfo)
59
0
{
60
0
  nsresult rv = nsSSLIOLayerAddToSocket(family,
61
0
                                        host,
62
0
                                        port,
63
0
                                        proxy,
64
0
                                        originAttributes,
65
0
                                        aSocket,
66
0
                                        securityInfo,
67
0
                                        false,
68
0
                                        flags,
69
0
                                        tlsFlags);
70
0
71
0
  return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
72
0
}