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

Side by Side Diff: vm/isolate.cc

Issue 10450016: Add a callback to inform embedders when an isolate is being shut down. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | « vm/isolate.h ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "lib/mirrors.h" 9 #include "lib/mirrors.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 "\tisolate: %s\n", name()); 386 "\tisolate: %s\n", name());
387 } 387 }
388 // TODO(5411455): For now just make sure there are no current isolates 388 // TODO(5411455): For now just make sure there are no current isolates
389 // as we are shutting down the isolate. 389 // as we are shutting down the isolate.
390 SetCurrent(NULL); 390 SetCurrent(NULL);
391 } 391 }
392 392
393 393
394 Dart_IsolateCreateCallback Isolate::create_callback_ = NULL; 394 Dart_IsolateCreateCallback Isolate::create_callback_ = NULL;
395 Dart_IsolateInterruptCallback Isolate::interrupt_callback_ = NULL; 395 Dart_IsolateInterruptCallback Isolate::interrupt_callback_ = NULL;
396 396 Dart_IsolateShutdownCallback Isolate::shutdown_callback_ = NULL;
397
398 void Isolate::SetCreateCallback(Dart_IsolateCreateCallback cb) {
399 create_callback_ = cb;
400 }
401
402
403 Dart_IsolateCreateCallback Isolate::CreateCallback() {
404 return create_callback_;
405 }
406
407
408 void Isolate::SetInterruptCallback(Dart_IsolateInterruptCallback cb) {
409 interrupt_callback_ = cb;
410 }
411
412
413 Dart_IsolateInterruptCallback Isolate::InterruptCallback() {
414 return interrupt_callback_;
415 }
416 397
417 398
418 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, 399 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
419 bool visit_prologue_weak_handles, 400 bool visit_prologue_weak_handles,
420 bool validate_frames) { 401 bool validate_frames) {
421 ASSERT(visitor != NULL); 402 ASSERT(visitor != NULL);
422 403
423 // Visit objects in the object store. 404 // Visit objects in the object store.
424 object_store()->VisitObjectPointers(visitor); 405 object_store()->VisitObjectPointers(visitor);
425 406
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 438
458 439
459 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, 440 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor,
460 bool visit_prologue_weak_handles) { 441 bool visit_prologue_weak_handles) {
461 if (api_state() != NULL) { 442 if (api_state() != NULL) {
462 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); 443 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles);
463 } 444 }
464 } 445 }
465 446
466 } // namespace dart 447 } // namespace dart
OLDNEW
« no previous file with comments | « vm/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698