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

Unified Diff: runtime/bin/extensions.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.h ('k') | runtime/bin/extensions_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/extensions.cc
diff --git a/runtime/bin/extensions.cc b/runtime/bin/extensions.cc
index 49e56151e53f2310b42ed71b269a3b290e7b7a61..eaed7bb38b1a2775e30c4563bab40295d2888a53 100644
--- a/runtime/bin/extensions.cc
+++ b/runtime/bin/extensions.cc
@@ -26,19 +26,17 @@ Dart_Handle Extensions::LoadExtension(const char* extension_directory,
}
const char* library_strings[] = { extension_directory, extension_file, NULL };
char* library_file = Concatenate(library_strings);
- void* library_handle = NULL;
- Dart_Handle result = LoadExtensionLibrary(library_file, &library_handle);
+ void* library_handle = LoadExtensionLibrary(library_file);
free(library_file);
- if (Dart_IsError(result)) {
- return result;
+ if (library_handle == NULL) {
+ return GetError();
}
- ASSERT(library_handle != NULL);
const char* strings[] = { extension_name, "_Init", NULL };
char* init_function_name = Concatenate(strings);
- void* init_function = NULL;
- result = ResolveSymbol(library_handle, init_function_name, &init_function);
+ void* init_function = ResolveSymbol(library_handle, init_function_name);
free(init_function_name);
+ Dart_Handle result = GetError();
if (Dart_IsError(result)) {
return result;
}
« no previous file with comments | « runtime/bin/extensions.h ('k') | runtime/bin/extensions_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698