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

Unified Diff: runtime/bin/isolate_data.cc

Issue 2694103004: Cleanup app snapshots on isolate/vm exit. (Closed)
Patch Set: merge Created 3 years, 10 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/isolate_data.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « runtime/bin/isolate_data.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698