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

Side by Side Diff: runtime/vm/isolate.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
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | 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 "vm/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/json.h" 9 #include "platform/json.h"
10 #include "lib/mirrors.h" 10 #include "lib/mirrors.h"
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 // Print the error if there is one. This may execute dart code to 642 // Print the error if there is one. This may execute dart code to
643 // print the exception object, so we need to use a StartIsolateScope. 643 // print the exception object, so we need to use a StartIsolateScope.
644 StartIsolateScope start_scope(isolate); 644 StartIsolateScope start_scope(isolate);
645 StackZone zone(isolate); 645 StackZone zone(isolate);
646 HandleScope handle_scope(isolate); 646 HandleScope handle_scope(isolate);
647 Error& error = Error::Handle(); 647 Error& error = Error::Handle();
648 error = isolate->object_store()->sticky_error(); 648 error = isolate->object_store()->sticky_error();
649 if (!error.IsNull()) { 649 if (!error.IsNull()) {
650 OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString()); 650 OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString());
651 } 651 }
652 Dart::RunShutdownCallback();
652 } 653 }
653 { 654 {
654 // Shut the isolate down. 655 // Shut the isolate down.
655 SwitchIsolateScope switch_scope(isolate); 656 SwitchIsolateScope switch_scope(isolate);
656 Dart::ShutdownIsolate(); 657 Dart::ShutdownIsolate();
657 } 658 }
658 } 659 }
659 660
660 661
661 void Isolate::Run() { 662 void Isolate::Run() {
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 return func.raw(); 1195 return func.raw();
1195 } 1196 }
1196 1197
1197 1198
1198 void IsolateSpawnState::Cleanup() { 1199 void IsolateSpawnState::Cleanup() {
1199 SwitchIsolateScope switch_scope(isolate()); 1200 SwitchIsolateScope switch_scope(isolate());
1200 Dart::ShutdownIsolate(); 1201 Dart::ShutdownIsolate();
1201 } 1202 }
1202 1203
1203 } // namespace dart 1204 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698