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

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

Issue 18862004: Call shutdown callback before the isolate is destroyed (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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
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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 } 792 }
793 *error = strdup(error_obj.ToErrorCString()); 793 *error = strdup(error_obj.ToErrorCString());
794 } 794 }
795 Dart::ShutdownIsolate(); 795 Dart::ShutdownIsolate();
796 return reinterpret_cast<Dart_Isolate>(NULL); 796 return reinterpret_cast<Dart_Isolate>(NULL);
797 } 797 }
798 798
799 799
800 DART_EXPORT void Dart_ShutdownIsolate() { 800 DART_EXPORT void Dart_ShutdownIsolate() {
801 CHECK_ISOLATE(Isolate::Current()); 801 CHECK_ISOLATE(Isolate::Current());
802 Isolate* isolate = Isolate::Current();
siva 2013/07/08 22:39:27 Move this line up and change: CHECK_ISOLATE(isolat
Cutch 2013/07/08 22:43:24 Done.
803 {
804 StartIsolateScope start_scope(isolate);
siva 2013/07/08 22:39:27 StartIsolateScope is pretty much a NOP here as sav
Cutch 2013/07/08 22:43:24 Done.
805 StackZone zone(isolate);
806 HandleScope handle_scope(isolate);
807 Dart::RunShutdownCallback();
808 }
802 STOP_TIMER(time_total_runtime); 809 STOP_TIMER(time_total_runtime);
803 Dart::ShutdownIsolate(); 810 Dart::ShutdownIsolate();
804 } 811 }
805 812
806 813
807 DART_EXPORT Dart_Isolate Dart_CurrentIsolate() { 814 DART_EXPORT Dart_Isolate Dart_CurrentIsolate() {
808 return Api::CastIsolate(Isolate::Current()); 815 return Api::CastIsolate(Isolate::Current());
809 } 816 }
810 817
811 818
(...skipping 3175 matching lines...) Expand 10 before | Expand all | Expand 10 after
3987 } 3994 }
3988 { 3995 {
3989 NoGCScope no_gc; 3996 NoGCScope no_gc;
3990 RawObject* raw_obj = obj.raw(); 3997 RawObject* raw_obj = obj.raw();
3991 isolate->heap()->SetPeer(raw_obj, peer); 3998 isolate->heap()->SetPeer(raw_obj, peer);
3992 } 3999 }
3993 return Api::Success(); 4000 return Api::Success();
3994 } 4001 }
3995 4002
3996 } // namespace dart 4003 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698