Fix typo in 9b54bd30006c008b4a951331b273613d5bac3abf
[pm.git] / xpcom / components / nsNativeModuleLoader.h
blobf4da312137a3630a493d238eecfe7534f55cabed
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 #ifndef nsNativeModuleLoader_h__
7 #define nsNativeModuleLoader_h__
9 #include "nsDataHashtable.h"
10 #include "nsHashKeys.h"
11 #include "prlink.h"
13 namespace mozilla {
14 class FileLocation;
17 class nsNativeModuleLoader final
19 public:
20 const mozilla::Module* LoadModule(mozilla::FileLocation& aFile);
22 nsresult Init();
24 void UnloadLibraries();
26 private:
27 struct NativeLoadData
29 NativeLoadData() : mModule(nullptr), mLibrary(nullptr) {}
31 const mozilla::Module* mModule;
32 PRLibrary* mLibrary;
35 static PLDHashOperator
36 ReleaserFunc(nsIHashable* aHashedFile, NativeLoadData& aLoadData, void*);
38 static PLDHashOperator
39 UnloaderFunc(nsIHashable* aHashedFile, NativeLoadData& aLoadData, void*);
41 nsDataHashtable<nsHashableHashKey, NativeLoadData> mLibraries;
44 #endif /* nsNativeModuleLoader_h__ */