Line data Source code
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 mozilla_ModuleLoader_h
8 : #define mozilla_ModuleLoader_h
9 :
10 : #include "nsISupports.h"
11 : #include "mozilla/Module.h"
12 : #include "mozilla/FileLocation.h"
13 :
14 : #define MOZILLA_MODULELOADER_PSEUDO_IID \
15 : { 0xD951A8CE, 0x6E9F, 0x464F, \
16 : { 0x8A, 0xC8, 0x14, 0x61, 0xC0, 0xD3, 0x63, 0xC8 } }
17 :
18 : namespace mozilla {
19 :
20 : /**
21 : * Module loaders are responsible for loading a component file. The static
22 : * component loader is special and does not use this abstract interface.
23 : *
24 : * @note Implementations of this interface should be threadsafe,
25 : * methods may be called from any thread.
26 : */
27 3 : class ModuleLoader : public nsISupports
28 : {
29 : public:
30 : NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_MODULELOADER_PSEUDO_IID)
31 :
32 : /**
33 : * Return the module for a specified file. The caller should cache
34 : * the module: the implementer should not expect for the same file
35 : * to be loaded multiple times. The Module object should either be
36 : * statically or permanently allocated; it will not be freed.
37 : */
38 : virtual const Module* LoadModule(mozilla::FileLocation& aFile) = 0;
39 : };
40 : NS_DEFINE_STATIC_IID_ACCESSOR(ModuleLoader, MOZILLA_MODULELOADER_PSEUDO_IID)
41 :
42 : } // namespace mozilla
43 :
44 : #endif // mozilla_ModuleLoader_h
|