tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsBaseParentChannel.cpp (2173B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 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 file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "nsBaseParentChannel.h"
      8 
      9 NS_IMPL_ISUPPORTS(nsBaseParentChannel, nsIParentChannel, nsIStreamListener,
     10                  nsIRequestObserver)
     11 
     12 NS_IMETHODIMP
     13 nsBaseParentChannel::SetParentListener(
     14    mozilla::net::ParentChannelListener* aListener) {
     15  // Nothing to do.
     16  return NS_OK;
     17 }
     18 
     19 NS_IMETHODIMP
     20 nsBaseParentChannel::NotifyClassificationFlags(uint32_t aClassificationFlags,
     21                                               bool aIsThirdParty) {
     22  // Nothing to do
     23  return NS_OK;
     24 }
     25 
     26 NS_IMETHODIMP
     27 nsBaseParentChannel::SetClassifierMatchedInfo(const nsACString& aList,
     28                                              const nsACString& aProvider,
     29                                              const nsACString& aPrefix) {
     30  // Nothing to do
     31  return NS_OK;
     32 }
     33 
     34 NS_IMETHODIMP
     35 nsBaseParentChannel::SetClassifierMatchedTrackingInfo(
     36    const nsACString& aLists, const nsACString& aFullHashes) {
     37  // Nothing to do
     38  return NS_OK;
     39 }
     40 
     41 NS_IMETHODIMP
     42 nsBaseParentChannel::Delete() {
     43  // Nothing to do
     44  return NS_OK;
     45 }
     46 
     47 NS_IMETHODIMP
     48 nsBaseParentChannel::GetRemoteType(nsACString& aRemoteType) {
     49  aRemoteType = mRemoteType;
     50  return NS_OK;
     51 }
     52 
     53 NS_IMETHODIMP
     54 nsBaseParentChannel::OnStartRequest(nsIRequest* aRequest) {
     55  // The redirect unconditionally resumes the channel we're bound to.
     56  // We cancel the channel ASAP so we stop receiving further data.
     57  return NS_BINDING_ABORTED;
     58 }
     59 
     60 NS_IMETHODIMP
     61 nsBaseParentChannel::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
     62  // See above.
     63  MOZ_ASSERT(NS_FAILED(aStatusCode));
     64  return NS_OK;
     65 }
     66 
     67 NS_IMETHODIMP
     68 nsBaseParentChannel::OnDataAvailable(nsIRequest* aRequest,
     69                                     nsIInputStream* aInputStream,
     70                                     uint64_t aOffset, uint32_t aCount) {
     71  // See above.
     72  MOZ_CRASH("Should never be called unless overridden");
     73 }