OLD | NEW |
1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3274 virtual OutputEncoding GetOutputEncoding() { return kAscii; } | 3274 virtual OutputEncoding GetOutputEncoding() { return kAscii; } |
3275 /** | 3275 /** |
3276 * Writes the next chunk of snapshot data into the stream. Writing | 3276 * Writes the next chunk of snapshot data into the stream. Writing |
3277 * can be stopped by returning kAbort as function result. EndOfStream | 3277 * can be stopped by returning kAbort as function result. EndOfStream |
3278 * will not be called in case writing was aborted. | 3278 * will not be called in case writing was aborted. |
3279 */ | 3279 */ |
3280 virtual WriteResult WriteAsciiChunk(char* data, int size) = 0; | 3280 virtual WriteResult WriteAsciiChunk(char* data, int size) = 0; |
3281 }; | 3281 }; |
3282 | 3282 |
3283 | 3283 |
3284 /** | |
3285 * An interface for reporting progress and controlling long-running | |
3286 * activities. | |
3287 */ | |
3288 class V8EXPORT ActivityControl { // NOLINT | |
3289 public: | |
3290 enum ControlOption { | |
3291 kContinue = 0, | |
3292 kAbort = 1 | |
3293 }; | |
3294 virtual ~ActivityControl() {} | |
3295 /** | |
3296 * Notify about current progress. The activity can be stopped by | |
3297 * returning kAbort as the callback result. | |
3298 */ | |
3299 virtual ControlOption ReportProgressValue(int done, int total) = 0; | |
3300 }; | |
3301 | |
3302 | 3284 |
3303 // --- I m p l e m e n t a t i o n --- | 3285 // --- I m p l e m e n t a t i o n --- |
3304 | 3286 |
3305 | 3287 |
3306 namespace internal { | 3288 namespace internal { |
3307 | 3289 |
3308 static const int kApiPointerSize = sizeof(void*); // NOLINT | 3290 static const int kApiPointerSize = sizeof(void*); // NOLINT |
3309 static const int kApiIntSize = sizeof(int); // NOLINT | 3291 static const int kApiIntSize = sizeof(int); // NOLINT |
3310 | 3292 |
3311 // Tag information for HeapObject. | 3293 // Tag information for HeapObject. |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3762 | 3744 |
3763 | 3745 |
3764 } // namespace v8 | 3746 } // namespace v8 |
3765 | 3747 |
3766 | 3748 |
3767 #undef V8EXPORT | 3749 #undef V8EXPORT |
3768 #undef TYPE_CHECK | 3750 #undef TYPE_CHECK |
3769 | 3751 |
3770 | 3752 |
3771 #endif // V8_H_ | 3753 #endif // V8_H_ |
OLD | NEW |