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