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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 25674009: Add framework for Dart_Terminate which will cleanup stuff on exit. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 const char* err_msg = Dart::InitOnce(create, interrupt, unhandled, shutdown, 754 const char* err_msg = Dart::InitOnce(create, interrupt, unhandled, shutdown,
755 file_open, file_read, file_write, 755 file_open, file_read, file_write,
756 file_close); 756 file_close);
757 if (err_msg != NULL) { 757 if (err_msg != NULL) {
758 OS::PrintErr("Dart_Initialize: %s\n", err_msg); 758 OS::PrintErr("Dart_Initialize: %s\n", err_msg);
759 return false; 759 return false;
760 } 760 }
761 return true; 761 return true;
762 } 762 }
763 763
764
765 DART_EXPORT bool Dart_Cleanup() {
766 CHECK_NO_ISOLATE(Isolate::Current());
767 const char* err_msg = Dart::Cleanup();
768 if (err_msg != NULL) {
769 OS::PrintErr("Dart_Cleanup: %s\n", err_msg);
770 return false;
771 }
772 return true;
773 }
774
775
764 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv) { 776 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv) {
765 return Flags::ProcessCommandLineFlags(argc, argv); 777 return Flags::ProcessCommandLineFlags(argc, argv);
766 } 778 }
767 779
780
768 DART_EXPORT bool Dart_IsVMFlagSet(const char* flag_name) { 781 DART_EXPORT bool Dart_IsVMFlagSet(const char* flag_name) {
769 if (Flags::Lookup(flag_name) != NULL) { 782 if (Flags::Lookup(flag_name) != NULL) {
770 return true; 783 return true;
771 } 784 }
772 return false; 785 return false;
773 } 786 }
774 787
775 788
776 // --- Isolates --- 789 // --- Isolates ---
777 790
(...skipping 3523 matching lines...) Expand 10 before | Expand all | Expand 10 after
4301 } 4314 }
4302 { 4315 {
4303 NoGCScope no_gc; 4316 NoGCScope no_gc;
4304 RawObject* raw_obj = obj.raw(); 4317 RawObject* raw_obj = obj.raw();
4305 isolate->heap()->SetPeer(raw_obj, peer); 4318 isolate->heap()->SetPeer(raw_obj, peer);
4306 } 4319 }
4307 return Api::Success(); 4320 return Api::Success();
4308 } 4321 }
4309 4322
4310 } // namespace dart 4323 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698