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

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
« runtime/include/dart_api.h ('K') | « 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 }
653 {
654 // Shut the isolate down. 652 // Shut the isolate down.
siva 2013/07/08 21:54:39 I think this may end up accessing the deleted isol
655 SwitchIsolateScope switch_scope(isolate);
656 Dart::ShutdownIsolate(); 653 Dart::ShutdownIsolate();
657 } 654 }
658 } 655 }
659 656
660 657
661 void Isolate::Run() { 658 void Isolate::Run() {
662 message_handler()->Run(Dart::thread_pool(), 659 message_handler()->Run(Dart::thread_pool(),
663 RunIsolate, 660 RunIsolate,
664 ShutdownIsolate, 661 ShutdownIsolate,
665 reinterpret_cast<uword>(this)); 662 reinterpret_cast<uword>(this));
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 return func.raw(); 1191 return func.raw();
1195 } 1192 }
1196 1193
1197 1194
1198 void IsolateSpawnState::Cleanup() { 1195 void IsolateSpawnState::Cleanup() {
1199 SwitchIsolateScope switch_scope(isolate()); 1196 SwitchIsolateScope switch_scope(isolate());
1200 Dart::ShutdownIsolate(); 1197 Dart::ShutdownIsolate();
1201 } 1198 }
1202 1199
1203 } // namespace dart 1200 } // namespace dart
OLDNEW
« runtime/include/dart_api.h ('K') | « 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