Line data Source code
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 0 : NS_IMPL_ISUPPORTS(DataChannelParent, nsIParentChannel, nsIStreamListener)
16 :
17 0 : DataChannelParent::~DataChannelParent()
18 : {
19 0 : }
20 :
21 : bool
22 0 : DataChannelParent::Init(const uint32_t &channelId)
23 : {
24 0 : nsCOMPtr<nsIChannel> channel;
25 0 : MOZ_ALWAYS_SUCCEEDS(
26 : NS_LinkRedirectChannels(channelId, this, getter_AddRefs(channel)));
27 :
28 0 : return true;
29 : }
30 :
31 : NS_IMETHODIMP
32 0 : DataChannelParent::SetParentListener(HttpChannelParentListener* aListener)
33 : {
34 : // Nothing to do.
35 0 : return NS_OK;
36 : }
37 :
38 : NS_IMETHODIMP
39 0 : DataChannelParent::NotifyTrackingProtectionDisabled()
40 : {
41 : // Nothing to do.
42 0 : return NS_OK;
43 : }
44 :
45 : NS_IMETHODIMP
46 0 : DataChannelParent::NotifyTrackingResource()
47 : {
48 : // Nothing to do.
49 0 : return NS_OK;
50 : }
51 :
52 : NS_IMETHODIMP
53 0 : DataChannelParent::SetClassifierMatchedInfo(const nsACString& aList,
54 : const nsACString& aProvider,
55 : const nsACString& aPrefix)
56 : {
57 : // nothing to do
58 0 : return NS_OK;
59 : }
60 :
61 : NS_IMETHODIMP
62 0 : DataChannelParent::Delete()
63 : {
64 : // Nothing to do.
65 0 : return NS_OK;
66 : }
67 :
68 : void
69 0 : DataChannelParent::ActorDestroy(ActorDestroyReason why)
70 : {
71 0 : }
72 :
73 : NS_IMETHODIMP
74 0 : DataChannelParent::OnStartRequest(nsIRequest *aRequest,
75 : nsISupports *aContext)
76 : {
77 : // We don't have a way to prevent nsBaseChannel from calling AsyncOpen on
78 : // the created nsDataChannel. We don't have anywhere to send the data in the
79 : // parent, so abort the binding.
80 0 : return NS_BINDING_ABORTED;
81 : }
82 :
83 : NS_IMETHODIMP
84 0 : DataChannelParent::OnStopRequest(nsIRequest *aRequest,
85 : nsISupports *aContext,
86 : nsresult aStatusCode)
87 : {
88 : // See above.
89 0 : MOZ_ASSERT(NS_FAILED(aStatusCode));
90 0 : return NS_OK;
91 : }
92 :
93 : NS_IMETHODIMP
94 0 : DataChannelParent::OnDataAvailable(nsIRequest *aRequest,
95 : nsISupports *aContext,
96 : nsIInputStream *aInputStream,
97 : uint64_t aOffset,
98 : uint32_t aCount)
99 : {
100 : // See above.
101 0 : MOZ_CRASH("Should never be called");
102 : }
103 :
104 : } // namespace net
105 : } // namespace mozilla
|