tor-browser

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

nsContentDLF.h (1486B)


      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
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef nsContentDLF_h__
      8 #define nsContentDLF_h__
      9 
     10 #include "nsIDocumentLoaderFactory.h"
     11 #include "nsMimeTypes.h"
     12 
     13 class nsDocShell;
     14 class nsIChannel;
     15 class nsIDocumentViewer;
     16 class nsILoadGroup;
     17 class nsIStreamListener;
     18 
     19 #define CONTENT_DLF_CONTRACTID "@mozilla.org/content/document-loader-factory;1"
     20 #define PLUGIN_DLF_CONTRACTID \
     21  "@mozilla.org/content/plugin/document-loader-factory;1"
     22 
     23 class nsContentDLF final : public nsIDocumentLoaderFactory {
     24 protected:
     25  virtual ~nsContentDLF();
     26 
     27 public:
     28  nsContentDLF();
     29 
     30  NS_DECL_ISUPPORTS
     31  NS_DECL_NSIDOCUMENTLOADERFACTORY
     32 
     33  nsresult InitUAStyleSheet();
     34 
     35  /**
     36   * Create a blank document using the given loadgroup and given
     37   * principal.  aPrincipal is allowed to be null, in which case the
     38   * new document will get the about:blank content principal.
     39   */
     40  static already_AddRefed<mozilla::dom::Document> CreateBlankDocument(
     41      nsILoadGroup* aLoadGroup, nsIPrincipal* aPrincipal,
     42      nsIPrincipal* aPartitionedPrincipal, nsDocShell* aContainer);
     43 
     44 private:
     45  static nsresult EnsureUAStyleSheet();
     46 };
     47 
     48 nsresult NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult);
     49 
     50 #endif