| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 5419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5430 internal::Isolate* isolate_; | 5430 internal::Isolate* isolate_; |
| 5431 | 5431 |
| 5432 static bool active_; | 5432 static bool active_; |
| 5433 | 5433 |
| 5434 // Disallow copying and assigning. | 5434 // Disallow copying and assigning. |
| 5435 Locker(const Locker&); | 5435 Locker(const Locker&); |
| 5436 void operator=(const Locker&); | 5436 void operator=(const Locker&); |
| 5437 }; | 5437 }; |
| 5438 | 5438 |
| 5439 | 5439 |
| 5440 /** | |
| 5441 * A struct for exporting HeapStats data from V8, using "push" model. | |
| 5442 */ | |
| 5443 struct HeapStatsUpdate; | |
| 5444 | |
| 5445 | |
| 5446 /** | |
| 5447 * An interface for exporting data from V8, using "push" model. | |
| 5448 */ | |
| 5449 class V8_EXPORT OutputStream { // NOLINT | |
| 5450 public: | |
| 5451 enum OutputEncoding { | |
| 5452 kAscii = 0 // 7-bit ASCII. | |
| 5453 }; | |
| 5454 enum WriteResult { | |
| 5455 kContinue = 0, | |
| 5456 kAbort = 1 | |
| 5457 }; | |
| 5458 virtual ~OutputStream() {} | |
| 5459 /** Notify about the end of stream. */ | |
| 5460 virtual void EndOfStream() = 0; | |
| 5461 /** Get preferred output chunk size. Called only once. */ | |
| 5462 virtual int GetChunkSize() { return 1024; } | |
| 5463 /** Get preferred output encoding. Called only once. */ | |
| 5464 virtual OutputEncoding GetOutputEncoding() { return kAscii; } | |
| 5465 /** | |
| 5466 * Writes the next chunk of snapshot data into the stream. Writing | |
| 5467 * can be stopped by returning kAbort as function result. EndOfStream | |
| 5468 * will not be called in case writing was aborted. | |
| 5469 */ | |
| 5470 virtual WriteResult WriteAsciiChunk(char* data, int size) = 0; | |
| 5471 /** | |
| 5472 * Writes the next chunk of heap stats data into the stream. Writing | |
| 5473 * can be stopped by returning kAbort as function result. EndOfStream | |
| 5474 * will not be called in case writing was aborted. | |
| 5475 */ | |
| 5476 virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) { | |
| 5477 return kAbort; | |
| 5478 }; | |
| 5479 }; | |
| 5480 | |
| 5481 | |
| 5482 /** | |
| 5483 * An interface for reporting progress and controlling long-running | |
| 5484 * activities. | |
| 5485 */ | |
| 5486 class V8_EXPORT ActivityControl { // NOLINT | |
| 5487 public: | |
| 5488 enum ControlOption { | |
| 5489 kContinue = 0, | |
| 5490 kAbort = 1 | |
| 5491 }; | |
| 5492 virtual ~ActivityControl() {} | |
| 5493 /** | |
| 5494 * Notify about current progress. The activity can be stopped by | |
| 5495 * returning kAbort as the callback result. | |
| 5496 */ | |
| 5497 virtual ControlOption ReportProgressValue(int done, int total) = 0; | |
| 5498 }; | |
| 5499 | |
| 5500 | |
| 5501 // --- Implementation --- | 5440 // --- Implementation --- |
| 5502 | 5441 |
| 5503 | 5442 |
| 5504 namespace internal { | 5443 namespace internal { |
| 5505 | 5444 |
| 5506 const int kApiPointerSize = sizeof(void*); // NOLINT | 5445 const int kApiPointerSize = sizeof(void*); // NOLINT |
| 5507 const int kApiIntSize = sizeof(int); // NOLINT | 5446 const int kApiIntSize = sizeof(int); // NOLINT |
| 5508 | 5447 |
| 5509 // Tag information for HeapObject. | 5448 // Tag information for HeapObject. |
| 5510 const int kHeapObjectTag = 1; | 5449 const int kHeapObjectTag = 1; |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6697 */ | 6636 */ |
| 6698 | 6637 |
| 6699 | 6638 |
| 6700 } // namespace v8 | 6639 } // namespace v8 |
| 6701 | 6640 |
| 6702 | 6641 |
| 6703 #undef TYPE_CHECK | 6642 #undef TYPE_CHECK |
| 6704 | 6643 |
| 6705 | 6644 |
| 6706 #endif // V8_H_ | 6645 #endif // V8_H_ |
| OLD | NEW |