OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 * two data chunks, but doesn't handle multi-byte characters split between | 1215 * two data chunks, but doesn't handle multi-byte characters split between |
1216 * more than two data chunks. The embedder can avoid this problem by always | 1216 * more than two data chunks. The embedder can avoid this problem by always |
1217 * returning at least 2 bytes of data. | 1217 * returning at least 2 bytes of data. |
1218 * | 1218 * |
1219 * If the embedder wants to cancel the streaming, they should make the next | 1219 * If the embedder wants to cancel the streaming, they should make the next |
1220 * GetMoreData call return 0. V8 will interpret it as end of data (and most | 1220 * GetMoreData call return 0. V8 will interpret it as end of data (and most |
1221 * probably, parsing will fail). The streaming task will return as soon as | 1221 * probably, parsing will fail). The streaming task will return as soon as |
1222 * V8 has parsed the data it received so far. | 1222 * V8 has parsed the data it received so far. |
1223 */ | 1223 */ |
1224 virtual size_t GetMoreData(const uint8_t** src) = 0; | 1224 virtual size_t GetMoreData(const uint8_t** src) = 0; |
| 1225 |
| 1226 /** |
| 1227 * V8 calls this method to set a 'bookmark' at the current position in |
| 1228 * the source stream, for the purpose of (maybe) later calling |
| 1229 * ResetToBookmark. If ResetToBookmark is called later, then subsequent |
| 1230 * calls to GetMoreData should return the same data as they did when |
| 1231 * SetBookmark was called earlier. |
| 1232 * |
| 1233 * The embedder may return 'false' to indicate it cannot provide this |
| 1234 * functionality. |
| 1235 */ |
| 1236 virtual bool SetBookmark(); |
| 1237 |
| 1238 /** |
| 1239 * V8 calls this to return to a previously set bookmark. |
| 1240 */ |
| 1241 virtual void ResetToBookmark(); |
1225 }; | 1242 }; |
1226 | 1243 |
1227 | 1244 |
1228 /** | 1245 /** |
1229 * Source code which can be streamed into V8 in pieces. It will be parsed | 1246 * Source code which can be streamed into V8 in pieces. It will be parsed |
1230 * while streaming. It can be compiled after the streaming is complete. | 1247 * while streaming. It can be compiled after the streaming is complete. |
1231 * StreamedSource must be kept alive while the streaming task is ran (see | 1248 * StreamedSource must be kept alive while the streaming task is ran (see |
1232 * ScriptStreamingTask below). | 1249 * ScriptStreamingTask below). |
1233 */ | 1250 */ |
1234 class V8_EXPORT StreamedSource { | 1251 class V8_EXPORT StreamedSource { |
(...skipping 6880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8115 */ | 8132 */ |
8116 | 8133 |
8117 | 8134 |
8118 } // namespace v8 | 8135 } // namespace v8 |
8119 | 8136 |
8120 | 8137 |
8121 #undef TYPE_CHECK | 8138 #undef TYPE_CHECK |
8122 | 8139 |
8123 | 8140 |
8124 #endif // V8_H_ | 8141 #endif // V8_H_ |
OLD | NEW |