netwerk/protocol/res/nsResProtocolHandler.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 nsResProtocolHandler_h___
     7 #define nsResProtocolHandler_h___
     9 #include "nsIResProtocolHandler.h"
    10 #include "nsInterfaceHashtable.h"
    11 #include "nsWeakReference.h"
    12 #include "nsStandardURL.h"
    14 class nsIIOService;
    15 struct ResourceMapping;
    17 // nsResURL : overrides nsStandardURL::GetFile to provide nsIFile resolution
    18 class nsResURL : public nsStandardURL
    19 {
    20 public:
    21     nsResURL() : nsStandardURL(true) {}
    22     virtual nsStandardURL* StartClone();
    23     virtual nsresult EnsureFile();
    24     NS_IMETHOD GetClassIDNoAlloc(nsCID *aCID);
    25 };
    27 class nsResProtocolHandler : public nsIResProtocolHandler, public nsSupportsWeakReference
    28 {
    29 public:
    30     NS_DECL_THREADSAFE_ISUPPORTS
    31     NS_DECL_NSIPROTOCOLHANDLER
    32     NS_DECL_NSIRESPROTOCOLHANDLER
    34     nsResProtocolHandler();
    35     virtual ~nsResProtocolHandler();
    37     nsresult Init();
    39     void CollectSubstitutions(InfallibleTArray<ResourceMapping>& aResources);
    41 private:
    42     nsresult Init(nsIFile *aOmniJar);
    43     nsresult AddSpecialDir(const char* aSpecialDir, const nsACString& aSubstitution);
    44     nsInterfaceHashtable<nsCStringHashKey,nsIURI> mSubstitutions;
    45     nsCOMPtr<nsIIOService> mIOService;
    47     friend class nsResURL;
    48 };
    50 #endif /* nsResProtocolHandler_h___ */

mercurial