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

Unified Diff: runtime/bin/dartutils.cc

Issue 2475523002: Reload native extensions when starting from a snapshot. (Closed)
Patch Set: comment 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
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index d29c947deb5b631eafec385d03de59953b06a71d..08a8452eba349cab62e0f9fda888ef7acff185a9 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -233,6 +233,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698