Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=4 sw=2 sts=2 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 "SimpleChannelParent.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(SimpleChannelParent, nsIParentChannel, nsIStreamListener)
16
17
bool SimpleChannelParent::Init(const uint32_t& channelId) {
18
nsCOMPtr<nsIChannel> channel;
19
MOZ_ALWAYS_SUCCEEDS(
20
NS_LinkRedirectChannels(channelId, this, getter_AddRefs(channel)));
21
22
return true;
23
}
24
25
NS_IMETHODIMP
26
SimpleChannelParent::SetParentListener(HttpChannelParentListener* aListener) {
27
// Nothing to do.
28
return NS_OK;
29
}
30
31
NS_IMETHODIMP
32
SimpleChannelParent::NotifyChannelClassifierProtectionDisabled(
33
uint32_t aAcceptedReason) {
34
// Nothing to do.
35
return NS_OK;
36
}
37
38
NS_IMETHODIMP
39
SimpleChannelParent::NotifyCookieAllowed() {
40
// Nothing to do.
41
return NS_OK;
42
}
43
44
NS_IMETHODIMP
45
SimpleChannelParent::NotifyCookieBlocked(uint32_t aRejectedReason) {
46
// Nothing to do.
47
return NS_OK;
48
}
49
50
NS_IMETHODIMP
51
SimpleChannelParent::NotifyClassificationFlags(uint32_t aClassificationFlags,
52
bool aIsThirdParty) {
53
// Nothing to do.
54
return NS_OK;
55
}
56
57
NS_IMETHODIMP
58
SimpleChannelParent::NotifyFlashPluginStateChanged(
59
nsIHttpChannel::FlashPluginState aState) {
60
// Nothing to do.
61
return NS_OK;
62
}
63
64
NS_IMETHODIMP
65
SimpleChannelParent::SetClassifierMatchedInfo(const nsACString& aList,
66
const nsACString& aProvider,
67
const nsACString& aPrefix) {
68
// nothing to do
69
return NS_OK;
70
}
71
72
NS_IMETHODIMP
73
SimpleChannelParent::SetClassifierMatchedTrackingInfo(
74
const nsACString& aLists, const nsACString& aFullHashes) {
75
// nothing to do
76
return NS_OK;
77
}
78
79
NS_IMETHODIMP
80
SimpleChannelParent::Delete() {
81
// Nothing to do.
82
return NS_OK;
83
}
84
85
void SimpleChannelParent::ActorDestroy(ActorDestroyReason aWhy) {}
86
87
NS_IMETHODIMP
88
SimpleChannelParent::OnStartRequest(nsIRequest* aRequest) {
89
// We don't have a way to prevent nsBaseChannel from calling AsyncOpen on
90
// the created nsSimpleChannel. We don't have anywhere to send the data in the
91
// parent, so abort the binding.
92
return NS_BINDING_ABORTED;
93
}
94
95
NS_IMETHODIMP
96
SimpleChannelParent::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
97
// See above.
98
MOZ_ASSERT(NS_FAILED(aStatusCode));
99
return NS_OK;
100
}
101
102
NS_IMETHODIMP
103
SimpleChannelParent::OnDataAvailable(nsIRequest* aRequest,
104
nsIInputStream* aInputStream,
105
uint64_t aOffset, uint32_t aCount) {
106
// See above.
107
MOZ_CRASH("Should never be called");
108
}
109
110
} // namespace net
111
} // namespace mozilla