Index: runtime/bin/isolate_data.cc |
diff --git a/runtime/bin/isolate_data.cc b/runtime/bin/isolate_data.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b37cf178431042b05f922e5e3c17e02a6a74a7d5 |
--- /dev/null |
+++ b/runtime/bin/isolate_data.cc |
@@ -0,0 +1,48 @@ |
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+#include "bin/isolate_data.h" |
+#include "bin/snapshot_utils.h" |
+ |
+namespace dart { |
+namespace bin { |
+ |
+IsolateData::IsolateData(const char* url, |
+ const char* package_root, |
+ const char* packages_file, |
+ AppSnapshot* app_snapshot) |
+ : script_url((url != NULL) ? strdup(url) : NULL), |
+ package_root(NULL), |
+ packages_file(NULL), |
+ udp_receive_buffer(NULL), |
+ builtin_lib_(NULL), |
+ loader_(NULL), |
+ app_snapshot_(app_snapshot) { |
+ if (package_root != NULL) { |
+ ASSERT(packages_file == NULL); |
+ this->package_root = strdup(package_root); |
+ } else if (packages_file != NULL) { |
+ this->packages_file = strdup(packages_file); |
+ } |
+} |
+ |
+ |
+IsolateData::~IsolateData() { |
+ free(script_url); |
+ script_url = NULL; |
+ free(package_root); |
+ package_root = NULL; |
+ free(packages_file); |
+ packages_file = NULL; |
+ free(udp_receive_buffer); |
+ udp_receive_buffer = NULL; |
+ if (builtin_lib_ != NULL) { |
+ Dart_DeletePersistentHandle(builtin_lib_); |
+ } |
+ delete app_snapshot_; |
+ app_snapshot_ = NULL; |
+} |
+ |
+} // namespace bin |
+} // namespace dart |