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

Side by Side Diff: runtime/vm/isolate.h

Issue 11442024: Unify specification of file open, close, and write callbacks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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/heap_profiler.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) 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 #ifndef VM_ISOLATE_H_ 5 #ifndef VM_ISOLATE_H_
6 #define VM_ISOLATE_H_ 6 #define VM_ISOLATE_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/class_table.h" 10 #include "vm/class_table.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 return unhandled_exception_callback_; 261 return unhandled_exception_callback_;
262 } 262 }
263 263
264 static void SetShutdownCallback(Dart_IsolateShutdownCallback cb) { 264 static void SetShutdownCallback(Dart_IsolateShutdownCallback cb) {
265 shutdown_callback_ = cb; 265 shutdown_callback_ = cb;
266 } 266 }
267 static Dart_IsolateShutdownCallback ShutdownCallback() { 267 static Dart_IsolateShutdownCallback ShutdownCallback() {
268 return shutdown_callback_; 268 return shutdown_callback_;
269 } 269 }
270 270
271 static void SetFileCallbacks(Dart_FileOpenCallback file_open,
272 Dart_FileWriteCallback file_write,
273 Dart_FileCloseCallback file_close) {
274 file_open_callback_ = file_open;
275 file_write_callback_ = file_write;
276 file_close_callback_ = file_close;
277 }
278
279 static Dart_FileOpenCallback file_open_callback() {
280 return file_open_callback_;
281 }
282 static Dart_FileWriteCallback file_write_callback() {
283 return file_write_callback_;
284 }
285 static Dart_FileCloseCallback file_close_callback() {
286 return file_close_callback_;
287 }
288
271 intptr_t* deopt_cpu_registers_copy() const { 289 intptr_t* deopt_cpu_registers_copy() const {
272 return deopt_cpu_registers_copy_; 290 return deopt_cpu_registers_copy_;
273 } 291 }
274 void set_deopt_cpu_registers_copy(intptr_t* value) { 292 void set_deopt_cpu_registers_copy(intptr_t* value) {
275 ASSERT((value == NULL) || (deopt_cpu_registers_copy_ == NULL)); 293 ASSERT((value == NULL) || (deopt_cpu_registers_copy_ == NULL));
276 deopt_cpu_registers_copy_ = value; 294 deopt_cpu_registers_copy_ = value;
277 } 295 }
278 double* deopt_xmm_registers_copy() const { 296 double* deopt_xmm_registers_copy() const {
279 return deopt_xmm_registers_copy_; 297 return deopt_xmm_registers_copy_;
280 } 298 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 double* deopt_xmm_registers_copy_; 371 double* deopt_xmm_registers_copy_;
354 intptr_t* deopt_frame_copy_; 372 intptr_t* deopt_frame_copy_;
355 intptr_t deopt_frame_copy_size_; 373 intptr_t deopt_frame_copy_size_;
356 DeferredDouble* deferred_doubles_; 374 DeferredDouble* deferred_doubles_;
357 DeferredMint* deferred_mints_; 375 DeferredMint* deferred_mints_;
358 376
359 static Dart_IsolateCreateCallback create_callback_; 377 static Dart_IsolateCreateCallback create_callback_;
360 static Dart_IsolateInterruptCallback interrupt_callback_; 378 static Dart_IsolateInterruptCallback interrupt_callback_;
361 static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_; 379 static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_;
362 static Dart_IsolateShutdownCallback shutdown_callback_; 380 static Dart_IsolateShutdownCallback shutdown_callback_;
381 static Dart_FileOpenCallback file_open_callback_;
382 static Dart_FileWriteCallback file_write_callback_;
383 static Dart_FileCloseCallback file_close_callback_;
363 384
364 DISALLOW_COPY_AND_ASSIGN(Isolate); 385 DISALLOW_COPY_AND_ASSIGN(Isolate);
365 }; 386 };
366 387
367 // When we need to execute code in an isolate, we use the 388 // When we need to execute code in an isolate, we use the
368 // StartIsolateScope. 389 // StartIsolateScope.
369 class StartIsolateScope { 390 class StartIsolateScope {
370 public: 391 public:
371 explicit StartIsolateScope(Isolate* new_isolate) 392 explicit StartIsolateScope(Isolate* new_isolate)
372 : new_isolate_(new_isolate), saved_isolate_(Isolate::Current()) { 393 : new_isolate_(new_isolate), saved_isolate_(Isolate::Current()) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 Isolate* new_isolate_; 445 Isolate* new_isolate_;
425 Isolate* saved_isolate_; 446 Isolate* saved_isolate_;
426 uword saved_stack_limit_; 447 uword saved_stack_limit_;
427 448
428 DISALLOW_COPY_AND_ASSIGN(SwitchIsolateScope); 449 DISALLOW_COPY_AND_ASSIGN(SwitchIsolateScope);
429 }; 450 };
430 451
431 } // namespace dart 452 } // namespace dart
432 453
433 #endif // VM_ISOLATE_H_ 454 #endif // VM_ISOLATE_H_
OLDNEW
« no previous file with comments | « runtime/vm/heap_profiler.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698