jfroy | 32be1d41 | 2015-04-01 17:10:29 | [diff] [blame] | 1 | // Copyright (c) 2015 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. |
| 4 | |
| 5 | #include "base/native_library.h" |
| 6 | |
Hans Wennborg | a47ddf8 | 2020-05-05 18:08:07 | [diff] [blame] | 7 | #include "base/check.h" |
| 8 | #include "base/notreached.h" |
Jan Wilken Dörrie | 5db50ac | 2021-02-15 11:43:16 | [diff] [blame] | 9 | #include "base/strings/string_piece.h" |
thestig | 02c965b | 2016-06-14 18:52:23 | [diff] [blame] | 10 | #include "base/strings/string_util.h" |
| 11 | |
jfroy | 32be1d41 | 2015-04-01 17:10:29 | [diff] [blame] | 12 | namespace base { |
| 13 | |
| 14 | std::string NativeLibraryLoadError::ToString() const { |
| 15 | return message; |
| 16 | } |
| 17 | |
rockot | 596a0dd | 2016-08-26 00:57:51 | [diff] [blame] | 18 | NativeLibrary LoadNativeLibraryWithOptions(const base::FilePath& library_path, |
| 19 | const NativeLibraryOptions& options, |
| 20 | NativeLibraryLoadError* error) { |
jfroy | 32be1d41 | 2015-04-01 17:10:29 | [diff] [blame] | 21 | NOTIMPLEMENTED(); |
xhwang | 6a01b39 | 2015-11-10 07:48:30 | [diff] [blame] | 22 | if (error) |
| 23 | error->message = "Not implemented."; |
jfroy | 32be1d41 | 2015-04-01 17:10:29 | [diff] [blame] | 24 | return nullptr; |
| 25 | } |
| 26 | |
jfroy | 32be1d41 | 2015-04-01 17:10:29 | [diff] [blame] | 27 | void UnloadNativeLibrary(NativeLibrary library) { |
| 28 | NOTIMPLEMENTED(); |
| 29 | DCHECK(!library); |
| 30 | } |
| 31 | |
jfroy | 32be1d41 | 2015-04-01 17:10:29 | [diff] [blame] | 32 | void* GetFunctionPointerFromNativeLibrary(NativeLibrary library, |
thestig | e38fbd6 | 2016-06-10 21:54:40 | [diff] [blame] | 33 | StringPiece name) { |
jfroy | 32be1d41 | 2015-04-01 17:10:29 | [diff] [blame] | 34 | NOTIMPLEMENTED(); |
| 35 | return nullptr; |
| 36 | } |
| 37 | |
thestig | 02c965b | 2016-06-14 18:52:23 | [diff] [blame] | 38 | std::string GetNativeLibraryName(StringPiece name) { |
| 39 | DCHECK(IsStringASCII(name)); |
Jan Wilken Dörrie | 5db50ac | 2021-02-15 11:43:16 | [diff] [blame] | 40 | return std::string(name); |
jfroy | 32be1d41 | 2015-04-01 17:10:29 | [diff] [blame] | 41 | } |
| 42 | |
Xiaohan Wang | d807ec3 | 2018-04-03 01:31:44 | [diff] [blame] | 43 | std::string GetLoadableModuleName(StringPiece name) { |
| 44 | return GetNativeLibraryName(name); |
| 45 | } |
| 46 | |
jfroy | 32be1d41 | 2015-04-01 17:10:29 | [diff] [blame] | 47 | } // namespace base |