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

Unified Diff: src/startup-data-util.cc

Issue 2042253002: [icu] Support loading data file from default location (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Format Created 4 years, 6 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 | « src/snapshot/mksnapshot.cc ('k') | src/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/startup-data-util.cc
diff --git a/src/startup-data-util.cc b/src/startup-data-util.cc
index 4e0ad97a0cf6cc67b02adab929d73199c0852043..7c6d9ebf216ffa556a0a1f2c36ff6469deb4a305 100644
--- a/src/startup-data-util.cc
+++ b/src/startup-data-util.cc
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
+#include "src/base/file-utils.h"
#include "src/base/logging.h"
#include "src/base/platform/platform.h"
#include "src/utils.h"
@@ -77,27 +78,6 @@ void LoadFromFiles(const char* natives_blob, const char* snapshot_blob) {
atexit(&FreeStartupData);
}
-
-char* RelativePath(char** buffer, const char* exec_path, const char* name) {
- DCHECK(exec_path);
- int path_separator = static_cast<int>(strlen(exec_path)) - 1;
- while (path_separator >= 0 &&
- !base::OS::isDirectorySeparator(exec_path[path_separator])) {
- path_separator--;
- }
- if (path_separator >= 0) {
- int name_length = static_cast<int>(strlen(name));
- *buffer =
- reinterpret_cast<char*>(calloc(path_separator + name_length + 2, 1));
- *buffer[0] = '\0';
- strncat(*buffer, exec_path, path_separator + 1);
- strncat(*buffer, name, name_length);
- } else {
- *buffer = strdup(name);
- }
- return *buffer;
-}
-
} // namespace
#endif // V8_USE_EXTERNAL_STARTUP_DATA
« no previous file with comments | « src/snapshot/mksnapshot.cc ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698