netwerk/protocol/about/nsAboutProtocolHandler.h

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef nsAboutProtocolHandler_h___
     7 #define nsAboutProtocolHandler_h___
     9 #include "nsIProtocolHandler.h"
    10 #include "nsSimpleNestedURI.h"
    11 #include "mozilla/Attributes.h"
    13 class nsIURI;
    15 class nsAboutProtocolHandler : public nsIProtocolHandler
    16 {
    17 public:
    18     NS_DECL_ISUPPORTS
    20     // nsIProtocolHandler methods:
    21     NS_DECL_NSIPROTOCOLHANDLER
    23     // nsAboutProtocolHandler methods:
    24     nsAboutProtocolHandler() {}
    25     virtual ~nsAboutProtocolHandler() {}
    26 };
    28 class nsSafeAboutProtocolHandler MOZ_FINAL : public nsIProtocolHandler
    29 {
    30 public:
    31     NS_DECL_ISUPPORTS
    33     // nsIProtocolHandler methods:
    34     NS_DECL_NSIPROTOCOLHANDLER
    36     // nsSafeAboutProtocolHandler methods:
    37     nsSafeAboutProtocolHandler() {}
    39 private:
    40     ~nsSafeAboutProtocolHandler() {}
    41 };
    44 // Class to allow us to propagate the base URI to about:blank correctly
    45 class nsNestedAboutURI : public nsSimpleNestedURI {
    46 public:
    47     nsNestedAboutURI(nsIURI* aInnerURI, nsIURI* aBaseURI)
    48         : nsSimpleNestedURI(aInnerURI)
    49         , mBaseURI(aBaseURI)
    50     {}
    52     // For use only from deserialization
    53     nsNestedAboutURI() : nsSimpleNestedURI() {}
    55     virtual ~nsNestedAboutURI() {}
    57     // Override QI so we can QI to our CID as needed
    58     NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
    60     // Override StartClone(), the nsISerializable methods, and
    61     // GetClassIDNoAlloc; this last is needed to make our nsISerializable impl
    62     // work right.
    63     virtual nsSimpleURI* StartClone(RefHandlingEnum aRefHandlingMode);
    64     NS_IMETHOD Read(nsIObjectInputStream* aStream);
    65     NS_IMETHOD Write(nsIObjectOutputStream* aStream);
    66     NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc);
    68     nsIURI* GetBaseURI() const {
    69         return mBaseURI;
    70     }
    72 protected:
    73     nsCOMPtr<nsIURI> mBaseURI;
    74 };
    76 #endif /* nsAboutProtocolHandler_h___ */

mercurial