OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_SCOPED_NATIVE_LIBRARY_H_ | 5 #ifndef BASE_SCOPED_NATIVE_LIBRARY_H_ |
6 #define BASE_SCOPED_NATIVE_LIBRARY_H_ | 6 #define BASE_SCOPED_NATIVE_LIBRARY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/base_api.h" | 9 #include "base/base_export.h" |
10 #include "base/native_library.h" | 10 #include "base/native_library.h" |
11 | 11 |
12 class FilePath; | 12 class FilePath; |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 | 15 |
16 // A class which encapsulates a base::NativeLibrary object available only in a | 16 // A class which encapsulates a base::NativeLibrary object available only in a |
17 // scope. | 17 // scope. |
18 // This class automatically unloads the loaded library in its destructor. | 18 // This class automatically unloads the loaded library in its destructor. |
19 class BASE_API ScopedNativeLibrary { | 19 class BASE_EXPORT ScopedNativeLibrary { |
20 public: | 20 public: |
21 // Initializes with a NULL library. | 21 // Initializes with a NULL library. |
22 ScopedNativeLibrary(); | 22 ScopedNativeLibrary(); |
23 | 23 |
24 // Takes ownership of the given library handle. | 24 // Takes ownership of the given library handle. |
25 explicit ScopedNativeLibrary(NativeLibrary library); | 25 explicit ScopedNativeLibrary(NativeLibrary library); |
26 | 26 |
27 // Opens the given library and manages its lifetime. | 27 // Opens the given library and manages its lifetime. |
28 explicit ScopedNativeLibrary(const FilePath& library_path); | 28 explicit ScopedNativeLibrary(const FilePath& library_path); |
29 | 29 |
(...skipping 14 matching lines...) Expand all Loading... |
44 | 44 |
45 private: | 45 private: |
46 NativeLibrary library_; | 46 NativeLibrary library_; |
47 | 47 |
48 DISALLOW_COPY_AND_ASSIGN(ScopedNativeLibrary); | 48 DISALLOW_COPY_AND_ASSIGN(ScopedNativeLibrary); |
49 }; | 49 }; |
50 | 50 |
51 } // namespace base | 51 } // namespace base |
52 | 52 |
53 #endif // BASE_MEMORY_NATIVE_LIBRARY_H_ | 53 #endif // BASE_MEMORY_NATIVE_LIBRARY_H_ |
OLD | NEW |