tor-browser

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

WebBrowserPersistLocalDocument.h (1441B)


      1 /* -*- Mode: C++; tab-width: 4; 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 WebBrowserPersistLocalDocument_h__
      8 #define WebBrowserPersistLocalDocument_h__
      9 
     10 #include "mozilla/NotNull.h"
     11 #include "nsCOMPtr.h"
     12 #include "nsCycleCollectionParticipant.h"
     13 #include "nsIURI.h"
     14 #include "nsIWebBrowserPersistDocument.h"
     15 
     16 class nsIDocumentEncoder;
     17 class nsISHEntry;
     18 
     19 namespace mozilla {
     20 
     21 namespace dom {
     22 class Document;
     23 }
     24 
     25 class WebBrowserPersistLocalDocument final
     26    : public nsIWebBrowserPersistDocument {
     27 public:
     28  explicit WebBrowserPersistLocalDocument(dom::Document* aDocument);
     29 
     30  NotNull<const Encoding*> GetCharacterSet() const;
     31  uint32_t GetPersistFlags() const;
     32  nsIURI* GetBaseURI() const;
     33 
     34  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     35  NS_DECL_NSIWEBBROWSERPERSISTDOCUMENT
     36 
     37  NS_DECL_CYCLE_COLLECTION_CLASS(WebBrowserPersistLocalDocument)
     38 
     39 private:
     40  RefPtr<dom::Document> mDocument;
     41  uint32_t mPersistFlags;
     42 
     43  void DecideContentType(nsACString& aContentType);
     44  nsresult GetDocEncoder(const nsACString& aContentType, uint32_t aEncoderFlags,
     45                         nsIDocumentEncoder** aEncoder);
     46 
     47  virtual ~WebBrowserPersistLocalDocument();
     48 };
     49 
     50 }  // namespace mozilla
     51 
     52 #endif  // WebBrowserPersistLocalDocument_h__