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

Unified Diff: runtime/bin/extensions_android.cc

Issue 1401253004: Cleanup the extensions code to avoid the duplication that was introduced in the quick fix to turn t… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/extensions.cc ('k') | runtime/bin/extensions_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/extensions_android.cc
diff --git a/runtime/bin/extensions_android.cc b/runtime/bin/extensions_android.cc
index fc892e41790aae23deee3f48a9c74ed597ecbc07..0c79bffde08eb4329ff384f156b4311bddc80047 100644
--- a/runtime/bin/extensions_android.cc
+++ b/runtime/bin/extensions_android.cc
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-#include "platform/assert.h"
#include "platform/globals.h"
#if defined(TARGET_OS_ANDROID)
@@ -16,40 +15,23 @@ namespace bin {
const char* kPrecompiledLibraryName = "libprecompiled.so";
const char* kPrecompiledSymbolName = "_kInstructionsSnapshot";
-Dart_Handle Extensions::LoadExtensionLibrary(const char* library_file,
- void** library_handle) {
- ASSERT(library_handle != NULL);
- *library_handle = dlopen(library_file, RTLD_LAZY);
- if (*library_handle == NULL) {
- return Dart_NewApiError(dlerror());
- }
- return Dart_Null();
-}
-
void* Extensions::LoadExtensionLibrary(const char* library_file) {
return dlopen(library_file, RTLD_LAZY);
}
-Dart_Handle Extensions::ResolveSymbol(void* lib_handle,
- const char* symbol,
- void** init_function) {
- ASSERT(init_function != NULL);
+void* Extensions::ResolveSymbol(void* lib_handle, const char* symbol) {
dlerror();
- *init_function = dlsym(lib_handle, symbol);
- char* err_str = dlerror();
+ return dlsym(lib_handle, symbol);
+}
+
+Dart_Handle Extensions::GetError() {
+ const char* err_str = dlerror();
if (err_str != NULL) {
return Dart_NewApiError(err_str);
}
return Dart_Null();
}
-void* Extensions::ResolveSymbol(void* lib_handle, const char* symbol) {
- dlerror();
- void* result = dlsym(lib_handle, symbol);
- if (dlerror() != NULL) return NULL;
- return result;
-}
-
} // namespace bin
} // namespace dart
« no previous file with comments | « runtime/bin/extensions.cc ('k') | runtime/bin/extensions_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698