Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/netwerk/protocol/data/DataChannelParent.cpp
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* vim: set ts=4 sw=4 sts=4 et tw=80: */
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 "DataChannelParent.h"
8
#include "mozilla/Assertions.h"
9
#include "nsNetUtil.h"
10
#include "nsIChannel.h"
11
12
namespace mozilla {
13
namespace net {
14
15
NS_IMPL_ISUPPORTS(DataChannelParent, nsIParentChannel, nsIStreamListener)
16
17
bool
18
DataChannelParent::Init(const uint32_t &channelId)
19
0
{
20
0
    nsCOMPtr<nsIChannel> channel;
21
0
    MOZ_ALWAYS_SUCCEEDS(
22
0
        NS_LinkRedirectChannels(channelId, this, getter_AddRefs(channel)));
23
0
24
0
    return true;
25
0
}
26
27
NS_IMETHODIMP
28
DataChannelParent::SetParentListener(HttpChannelParentListener* aListener)
29
0
{
30
0
    // Nothing to do.
31
0
    return NS_OK;
32
0
}
33
34
NS_IMETHODIMP
35
DataChannelParent::NotifyTrackingProtectionDisabled()
36
0
{
37
0
    // Nothing to do.
38
0
    return NS_OK;
39
0
}
40
41
NS_IMETHODIMP
42
DataChannelParent::NotifyTrackingCookieBlocked(uint32_t aRejectedReason)
43
0
{
44
0
    // Nothing to do.
45
0
    return NS_OK;
46
0
}
47
48
NS_IMETHODIMP
49
DataChannelParent::NotifyTrackingResource(bool aIsThirdParty)
50
0
{
51
0
    // Nothing to do.
52
0
    return NS_OK;
53
0
}
54
55
NS_IMETHODIMP
56
DataChannelParent::SetClassifierMatchedInfo(const nsACString& aList,
57
                                            const nsACString& aProvider,
58
                                            const nsACString& aFullHash)
59
0
{
60
0
  // nothing to do
61
0
  return NS_OK;
62
0
}
63
64
NS_IMETHODIMP
65
DataChannelParent::Delete()
66
0
{
67
0
    // Nothing to do.
68
0
    return NS_OK;
69
0
}
70
71
void
72
DataChannelParent::ActorDestroy(ActorDestroyReason why)
73
0
{
74
0
}
75
76
NS_IMETHODIMP
77
DataChannelParent::OnStartRequest(nsIRequest *aRequest,
78
                                  nsISupports *aContext)
79
0
{
80
0
    // We don't have a way to prevent nsBaseChannel from calling AsyncOpen on
81
0
    // the created nsDataChannel. We don't have anywhere to send the data in the
82
0
    // parent, so abort the binding.
83
0
    return NS_BINDING_ABORTED;
84
0
}
85
86
NS_IMETHODIMP
87
DataChannelParent::OnStopRequest(nsIRequest *aRequest,
88
                                 nsISupports *aContext,
89
                                 nsresult aStatusCode)
90
0
{
91
0
    // See above.
92
0
    MOZ_ASSERT(NS_FAILED(aStatusCode));
93
0
    return NS_OK;
94
0
}
95
96
NS_IMETHODIMP
97
DataChannelParent::OnDataAvailable(nsIRequest *aRequest,
98
                                   nsISupports *aContext,
99
                                   nsIInputStream *aInputStream,
100
                                   uint64_t aOffset,
101
                                   uint32_t aCount)
102
0
{
103
0
    // See above.
104
0
    MOZ_CRASH("Should never be called");
105
0
}
106
107
} // namespace net
108
} // namespace mozilla