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

Unified Diff: runtime/bin/dartutils.cc

Issue 2894773004: Changes to make isolate reload functionality work with the --dfe option. (Closed)
Patch Set: Fix regression test errors. Created 3 years, 7 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 | « runtime/bin/dartutils.h ('k') | runtime/bin/dfe.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 e5685dfd2267f1d02fe6473afcdb8dc43d73405f..a07306dadec3e7cf78bd683471a94bbdc8125774 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -60,39 +60,6 @@ MagicNumberData snapshot_magic_number = {{0xf5, 0xf5, 0xdc, 0xdc}, true};
MagicNumberData kernel_magic_number = {{0x90, 0xab, 0xcd, 0xef}, false};
-bool TryReadKernel(const char* script_uri,
- const uint8_t** kernel_file,
- intptr_t* kernel_length) {
- *kernel_file = NULL;
- *kernel_length = -1;
- bool is_kernel_file = false;
- void* script_file = DartUtils::OpenFile(script_uri, false);
- if (script_file != NULL) {
- const uint8_t* buffer = NULL;
- DartUtils::ReadFile(&buffer, kernel_length, script_file);
- DartUtils::CloseFile(script_file);
- if (*kernel_length > 0 && buffer != NULL) {
- // We need a temporary variable because SniffForMagicNumber modifies the
- // buffer pointer to skip snapshot magic number.
- const uint8_t* temp = buffer;
- if (DartUtils::SniffForMagicNumber(&temp, kernel_length) !=
- DartUtils::kKernelMagicNumber) {
- free(const_cast<uint8_t*>(buffer));
- *kernel_file = NULL;
- } else {
- // Do not free buffer if this is a kernel file - kernel_file will be
- // backed by the same memory as the buffer and caller will own it.
- // Caller is responsible for freeing the buffer when this function
- // returns true.
- is_kernel_file = true;
- *kernel_file = buffer;
- }
- }
- }
- return is_kernel_file;
-}
-
-
static bool IsWindowsHost() {
#if defined(HOST_OS_WINDOWS)
return true;
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/dfe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698