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
3 // found in the LICENSE file.
5 #include "base/scoped_native_library.h"
9 ScopedNativeLibrary::ScopedNativeLibrary() : library_(nullptr) {}
11 ScopedNativeLibrary::ScopedNativeLibrary(NativeLibrary library)
15 ScopedNativeLibrary::ScopedNativeLibrary(const FilePath& library_path) {
16 library_ = base::LoadNativeLibrary(library_path, nullptr);
19 ScopedNativeLibrary::~ScopedNativeLibrary() {
21 base::UnloadNativeLibrary(library_);
24 void* ScopedNativeLibrary::GetFunctionPointer(
25 const char* function_name) const {
28 return base::GetFunctionPointerFromNativeLibrary(library_, function_name);
31 void ScopedNativeLibrary::Reset(NativeLibrary library) {
33 base::UnloadNativeLibrary(library_);
37 NativeLibrary ScopedNativeLibrary::Release() {
38 NativeLibrary result = library_;