tor-browser

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

nsIconChannel.h (1794B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
      2 *
      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 #ifndef mozilla_image_encoders_icon_mac_nsIconChannel_h
      8 #define mozilla_image_encoders_icon_mac_nsIconChannel_h
      9 
     10 #include "nsCOMPtr.h"
     11 #include "nsString.h"
     12 #include "nsIChannel.h"
     13 #include "nsILoadGroup.h"
     14 #include "nsILoadInfo.h"
     15 #include "nsIInterfaceRequestor.h"
     16 #include "nsIInterfaceRequestorUtils.h"
     17 #include "nsIInputStreamPump.h"
     18 #include "nsIStreamListener.h"
     19 #include "nsIURI.h"
     20 #include "nsNetUtil.h"
     21 
     22 class nsIFile;
     23 
     24 class nsIconChannel final : public nsIChannel, public nsIStreamListener {
     25 public:
     26  NS_DECL_THREADSAFE_ISUPPORTS
     27  NS_DECL_NSIREQUEST
     28  NS_DECL_NSICHANNEL
     29  NS_DECL_NSIREQUESTOBSERVER
     30  NS_DECL_NSISTREAMLISTENER
     31 
     32  nsIconChannel();
     33 
     34  nsresult Init(nsIURI* uri, nsILoadInfo* aLoadInfo);
     35 
     36 protected:
     37  virtual ~nsIconChannel();
     38 
     39  nsCOMPtr<nsIURI> mUrl;
     40  nsCOMPtr<nsIURI> mOriginalURI;
     41  nsCOMPtr<nsILoadGroup> mLoadGroup;
     42  nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
     43  nsCOMPtr<nsISupports> mOwner;
     44  nsCOMPtr<nsILoadInfo> mLoadInfo;
     45 
     46  nsCOMPtr<nsIInputStreamPump> mPump;
     47  nsCOMPtr<nsIStreamListener> mListener;
     48  bool mCanceled = false;
     49 
     50  [[nodiscard]] nsresult MakeInputStream(nsIInputStream** _retval,
     51                                         bool nonBlocking);
     52 
     53  nsresult ExtractIconInfoFromUrl(nsIFile** aLocalFile,
     54                                  uint32_t* aDesiredImageSize,
     55                                  nsACString& aContentType,
     56                                  nsACString& aFileExtension);
     57 };
     58 
     59 #endif  // mozilla_image_encoders_icon_mac_nsIconChannel_h