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

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

Issue 1292053002: Rework startup-data-util. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Same as Patch Set 3, but revert the "Test for all platforms" bits. Created 5 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
« no previous file with comments | « src/d8.gyp ('k') | src/startup-data-util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/startup-data-util.h
diff --git a/src/startup-data-util.h b/src/startup-data-util.h
index 79b4171343a1b6610e5d2a0bd3789084b85cef50..7cb51e362a9010597ce2ae561472145ea7cfcfb4 100644
--- a/src/startup-data-util.h
+++ b/src/startup-data-util.h
@@ -9,43 +9,21 @@
#include "include/v8.h"
namespace v8 {
+namespace internal {
-#ifdef V8_USE_EXTERNAL_STARTUP_DATA
-// Helper class to load the startup data files from disk.
+// Helper functions to load external startup data.
//
// This is meant as a convenience for stand-alone binaries like d8, cctest,
// unittest. A V8 embedder would likely either handle startup data on their
// own or just disable the feature if they don't want to handle it at all,
-// while tools like cctest need to work in either configuration. Hence this is
-// not meant for inclusion in the general v8 library.
-class StartupDataHandler {
- public:
- // Load startup data, and call the v8::V8::Set*DataBlob API functions.
- //
- // natives_blob and snapshot_blob will be loaded realitive to exec_path,
- // which would usually be the equivalent of argv[0].
- StartupDataHandler(const char* exec_path, const char* natives_blob,
- const char* snapshot_blob);
- ~StartupDataHandler();
-
- private:
- static char* RelativePath(char** buffer, const char* exec_path,
- const char* name);
-
- void LoadFromFiles(const char* natives_blob, const char* snapshot_blob);
-
- void Load(const char* blob_file, v8::StartupData* startup_data,
- void (*setter_fn)(v8::StartupData*));
-
- v8::StartupData natives_;
- v8::StartupData snapshot_;
-
- // Disallow copy & assign.
- StartupDataHandler(const StartupDataHandler& other);
- void operator=(const StartupDataHandler& other);
-};
-#endif // V8_USE_EXTERNAL_STARTUP_DATA
+// while tools like cctest need to work in either configuration.
+void InitializeExternalStartupData(const char* directory_path);
+
+void InitializeExternalStartupData(const char* natives_blob,
+ const char* snapshot_blob);
+
+} // namespace internal
} // namespace v8
#endif // V8_STARTUP_DATA_UTIL_H_
« no previous file with comments | « src/d8.gyp ('k') | src/startup-data-util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698