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

Unified Diff: runtime/bin/loader.cc

Issue 2285223003: Fix native extension lookup (Closed)
Patch Set: Add back test for '/' Created 4 years, 4 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
Index: runtime/bin/loader.cc
diff --git a/runtime/bin/loader.cc b/runtime/bin/loader.cc
index 22204788a81b4197e7021f6c7f70665417e66e8d..c6370617203d571879e1ac094e13282dc92df109 100644
--- a/runtime/bin/loader.cc
+++ b/runtime/bin/loader.cc
@@ -8,6 +8,7 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
#include "bin/extensions.h"
+#include "bin/file.h"
#include "bin/lockers.h"
#include "bin/utils.h"
@@ -261,15 +262,6 @@ static bool LibraryHandleError(Dart_Handle library, Dart_Handle error) {
}
-static bool IsWindowsHost() {
-#if defined(TARGET_OS_WINDOWS)
- return true;
-#else // defined(TARGET_OS_WINDOWS)
- return false;
-#endif // defined(TARGET_OS_WINDOWS)
-}
-
-
bool Loader::ProcessResultLocked(Loader* loader, Loader::IOResult* result) {
// We have to copy everything we care about out of |result| because after
// dropping the lock below |result| may no longer valid.
@@ -320,8 +312,9 @@ bool Loader::ProcessResultLocked(Loader* loader, Loader::IOResult* result) {
lib_path = lib_uri;
}
const char* extension_path = DartUtils::RemoveScheme(extension_uri);
- if (strchr(extension_path, '/') != NULL ||
- (IsWindowsHost() && strchr(extension_path, '\\') != NULL)) {
+ if (!File::IsAbsolutePath(extension_path) &&
+ ((strchr(extension_path, '/') != NULL) ||
+ (strstr(extension_path, File::PathSeparator()) != NULL))) {
siva 2016/08/30 01:22:59 For non windows hosts looks like this check is rep
zra 2016/08/30 16:05:18 Avoided the duplicate test by checking the path se
loader->error_ = DartUtils::NewError(
"Relative paths for dart extensions are not supported: '%s'",
extension_path);
« no previous file with comments | « runtime/bin/extensions.cc ('k') | runtime/bin/utils.h » ('j') | runtime/bin/utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698