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 3178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3189 bool top_level_; | 3189 bool top_level_; |
3190 | 3190 |
3191 static bool active_; | 3191 static bool active_; |
3192 | 3192 |
3193 // Disallow copying and assigning. | 3193 // Disallow copying and assigning. |
3194 Locker(const Locker&); | 3194 Locker(const Locker&); |
3195 void operator=(const Locker&); | 3195 void operator=(const Locker&); |
3196 }; | 3196 }; |
3197 | 3197 |
3198 | 3198 |
| 3199 /** |
| 3200 * An interface for exporting data from V8, using "push" model. |
| 3201 */ |
| 3202 class V8EXPORT OutputStream { |
| 3203 public: |
| 3204 enum OutputEncoding { |
| 3205 kAscii = 0 // 7-bit ASCII. |
| 3206 }; |
| 3207 virtual ~OutputStream() {} |
| 3208 /** Notify about the end of stream. */ |
| 3209 virtual void EndOfStream() = 0; |
| 3210 /** Get preferred output chunk size. Called only once. */ |
| 3211 virtual int GetChunkSize() { return 1024; } |
| 3212 /** Get preferred output encoding. Called only once. */ |
| 3213 virtual OutputEncoding GetOutputEncoding() { return kAscii; } |
| 3214 /** Writes the next chunk of snapshot data into the stream. */ |
| 3215 virtual void WriteAsciiChunk(char* data, int size) = 0; |
| 3216 }; |
| 3217 |
| 3218 |
3199 | 3219 |
3200 // --- I m p l e m e n t a t i o n --- | 3220 // --- I m p l e m e n t a t i o n --- |
3201 | 3221 |
3202 | 3222 |
3203 namespace internal { | 3223 namespace internal { |
3204 | 3224 |
3205 | 3225 |
3206 // Tag information for HeapObject. | 3226 // Tag information for HeapObject. |
3207 const int kHeapObjectTag = 1; | 3227 const int kHeapObjectTag = 1; |
3208 const int kHeapObjectTagSize = 2; | 3228 const int kHeapObjectTagSize = 2; |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3649 | 3669 |
3650 | 3670 |
3651 } // namespace v8 | 3671 } // namespace v8 |
3652 | 3672 |
3653 | 3673 |
3654 #undef V8EXPORT | 3674 #undef V8EXPORT |
3655 #undef TYPE_CHECK | 3675 #undef TYPE_CHECK |
3656 | 3676 |
3657 | 3677 |
3658 #endif // V8_H_ | 3678 #endif // V8_H_ |
OLD | NEW |