Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: runtime/bin/extensions_linux.cc

Issue 1800863002: Cleanup in //runtime/bin (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/bin/extensions_android.cc ('k') | runtime/bin/extensions_macos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_LINUX) 6 #if defined(TARGET_OS_LINUX)
7 7
8 #include "bin/extensions.h" 8 #include "bin/extensions.h"
9 #include <dlfcn.h> // NOLINT 9 #include <dlfcn.h> // NOLINT
10 10
11
12 namespace dart { 11 namespace dart {
13 namespace bin { 12 namespace bin {
14 13
15 const char* kPrecompiledLibraryName = "libprecompiled.so"; 14 const char* kPrecompiledLibraryName = "libprecompiled.so";
16 const char* kPrecompiledInstructionsSymbolName = "_kInstructionsSnapshot"; 15 const char* kPrecompiledInstructionsSymbolName = "_kInstructionsSnapshot";
17 const char* kPrecompiledDataSymbolName = "_kDataSnapshot"; 16 const char* kPrecompiledDataSymbolName = "_kDataSnapshot";
18 17
19 void* Extensions::LoadExtensionLibrary(const char* library_file) { 18 void* Extensions::LoadExtensionLibrary(const char* library_file) {
20 return dlopen(library_file, RTLD_LAZY); 19 return dlopen(library_file, RTLD_LAZY);
21 } 20 }
22 21
23 void* Extensions::ResolveSymbol(void* lib_handle, const char* symbol) { 22 void* Extensions::ResolveSymbol(void* lib_handle, const char* symbol) {
24 dlerror(); 23 dlerror();
25 return dlsym(lib_handle, symbol); 24 return dlsym(lib_handle, symbol);
26 } 25 }
27 26
28 Dart_Handle Extensions::GetError() { 27 Dart_Handle Extensions::GetError() {
29 const char* err_str = dlerror(); 28 const char* err_str = dlerror();
30 if (err_str != NULL) { 29 if (err_str != NULL) {
31 return Dart_NewApiError(err_str); 30 return Dart_NewApiError(err_str);
32 } 31 }
33 return Dart_Null(); 32 return Dart_Null();
34 } 33 }
35 34
36 } // namespace bin 35 } // namespace bin
37 } // namespace dart 36 } // namespace dart
38 37
39 #endif // defined(TARGET_OS_LINUX) 38 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/bin/extensions_android.cc ('k') | runtime/bin/extensions_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698