netwerk/base/src/nsSimpleNestedURI.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 4; 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 /**
     7  * URI class to be used for cases when a simple URI actually resolves to some
     8  * other sort of URI, with the latter being what's loaded when the load
     9  * happens.  All objects of this class should always be immutable, so that the
    10  * inner URI and this URI don't get out of sync.  The Clone() implementation
    11  * will guarantee this for the clone, but it's up to the protocol handlers
    12  * creating these URIs to ensure that in the first place.  The innerURI passed
    13  * to this URI will be set immutable if possible.
    14  */
    16 #ifndef nsSimpleNestedURI_h__
    17 #define nsSimpleNestedURI_h__
    19 #include "nsCOMPtr.h"
    20 #include "nsSimpleURI.h"
    21 #include "nsINestedURI.h"
    23 class nsSimpleNestedURI : public nsSimpleURI,
    24                           public nsINestedURI
    25 {
    26 public:
    27     // To be used by deserialization only.  Leaves this object in an
    28     // uninitialized state that will throw on most accesses.
    29     nsSimpleNestedURI()
    30     {
    31     }
    33     // Constructor that should generally be used when constructing an object of
    34     // this class with |operator new|.
    35     nsSimpleNestedURI(nsIURI* innerURI);
    37     NS_DECL_ISUPPORTS_INHERITED
    38     NS_DECL_NSINESTEDURI
    40     // Overrides for various methods nsSimpleURI implements follow.
    42     // nsSimpleURI overrides
    43     virtual nsresult EqualsInternal(nsIURI* other,
    44                                     RefHandlingEnum refHandlingMode,
    45                                     bool* result);
    46     virtual nsSimpleURI* StartClone(RefHandlingEnum refHandlingMode);
    48     // nsISerializable overrides
    49     NS_IMETHOD Read(nsIObjectInputStream* aStream);
    50     NS_IMETHOD Write(nsIObjectOutputStream* aStream);
    52     // Override the nsIClassInfo method GetClassIDNoAlloc to make sure our
    53     // nsISerializable impl works right.
    54     NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc);  
    56 protected:
    57     nsCOMPtr<nsIURI> mInnerURI;
    58 };
    60 #endif /* nsSimpleNestedURI_h__ */

mercurial