xpcom/components/ModuleLoader.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef mozilla_ModuleLoader_h
michael@0 7 #define mozilla_ModuleLoader_h
michael@0 8
michael@0 9 #include "nsISupports.h"
michael@0 10 #include "mozilla/Module.h"
michael@0 11 #include "mozilla/FileLocation.h"
michael@0 12
michael@0 13 #define MOZILLA_MODULELOADER_PSEUDO_IID \
michael@0 14 { 0xD951A8CE, 0x6E9F, 0x464F, \
michael@0 15 { 0x8A, 0xC8, 0x14, 0x61, 0xC0, 0xD3, 0x63, 0xC8 } }
michael@0 16
michael@0 17 namespace mozilla {
michael@0 18
michael@0 19 /**
michael@0 20 * Module loaders are responsible for loading a component file. The static
michael@0 21 * component loader is special and does not use this abstract interface.
michael@0 22 *
michael@0 23 * @note Implementations of this interface should be threadsafe,
michael@0 24 * methods may be called from any thread.
michael@0 25 */
michael@0 26 class ModuleLoader : public nsISupports
michael@0 27 {
michael@0 28 public:
michael@0 29 NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_MODULELOADER_PSEUDO_IID)
michael@0 30
michael@0 31 /**
michael@0 32 * Return the module for a specified file. The caller should cache
michael@0 33 * the module: the implementer should not expect for the same file
michael@0 34 * to be loaded multiple times. The Module object should either be
michael@0 35 * statically or permanently allocated; it will not be freed.
michael@0 36 */
michael@0 37 virtual const Module* LoadModule(mozilla::FileLocation &aFile) = 0;
michael@0 38 };
michael@0 39 NS_DEFINE_STATIC_IID_ACCESSOR(ModuleLoader, MOZILLA_MODULELOADER_PSEUDO_IID)
michael@0 40
michael@0 41 } // namespace mozilla
michael@0 42
michael@0 43 #endif // mozilla_ModuleLoader_h

mercurial