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/. */
7 #include "SimpleChannelParent.h"
8 #include "mozilla/Assertions.h"
10 #include "nsIChannel.h"
12 #ifdef FUZZING_SNAPSHOT
13 # define MOZ_ALWAYS_SUCCEEDS_FUZZING(...) (void)__VA_ARGS__
15 # define MOZ_ALWAYS_SUCCEEDS_FUZZING(...) MOZ_ALWAYS_SUCCEEDS(__VA_ARGS__)
21 NS_IMPL_ISUPPORTS(SimpleChannelParent
, nsIParentChannel
, nsIStreamListener
)
23 bool SimpleChannelParent::Init(const uint64_t& aChannelId
) {
24 nsCOMPtr
<nsIChannel
> channel
;
26 MOZ_ALWAYS_SUCCEEDS_FUZZING(
27 NS_LinkRedirectChannels(aChannelId
, this, getter_AddRefs(channel
)));
33 SimpleChannelParent::SetParentListener(ParentChannelListener
* aListener
) {
39 SimpleChannelParent::NotifyClassificationFlags(uint32_t aClassificationFlags
,
46 SimpleChannelParent::SetClassifierMatchedInfo(const nsACString
& aList
,
47 const nsACString
& aProvider
,
48 const nsACString
& aPrefix
) {
54 SimpleChannelParent::SetClassifierMatchedTrackingInfo(
55 const nsACString
& aLists
, const nsACString
& aFullHashes
) {
61 SimpleChannelParent::Delete() {
67 SimpleChannelParent::GetRemoteType(nsACString
& aRemoteType
) {
68 return NS_ERROR_NOT_IMPLEMENTED
;
71 void SimpleChannelParent::ActorDestroy(ActorDestroyReason aWhy
) {}
74 SimpleChannelParent::OnStartRequest(nsIRequest
* aRequest
) {
75 // We don't have a way to prevent nsBaseChannel from calling AsyncOpen on
76 // the created nsSimpleChannel. We don't have anywhere to send the data in the
77 // parent, so abort the binding.
78 return NS_BINDING_ABORTED
;
82 SimpleChannelParent::OnStopRequest(nsIRequest
* aRequest
, nsresult aStatusCode
) {
84 MOZ_ASSERT(NS_FAILED(aStatusCode
));
89 SimpleChannelParent::OnDataAvailable(nsIRequest
* aRequest
,
90 nsIInputStream
* aInputStream
,
91 uint64_t aOffset
, uint32_t aCount
) {
93 MOZ_CRASH("Should never be called");
97 } // namespace mozilla