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

Unified Diff: runtime/bin/dartutils.cc

Issue 2475523002: Reload native extensions when starting from a snapshot. (Closed)
Patch Set: . Created 4 years, 1 month 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/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index ff8b53d48d260f7ca00dd1cd6746e623291a670d..d1af47c3d3bdadc2fc32fd7e5b8b50ce58fccad3 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -232,6 +232,16 @@ const char* DartUtils::RemoveScheme(const char* url) {
}
+char* DartUtils::DirName(const char* url) {
+ const char* slash = strrchr(url, File::PathSeparator()[0]);
+ if (slash == NULL) {
+ return strdup(url);
+ } else {
+ return strndup(url, slash - url + 1);
+ }
+}
+
+
void* DartUtils::OpenFile(const char* name, bool write) {
File* file = File::Open(name, write ? File::kWriteTruncate : File::kRead);
return reinterpret_cast<void*>(file);
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/loader.h » ('j') | runtime/include/dart_api.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698