OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2253 */ | 2253 */ |
2254 void Exit(); | 2254 void Exit(); |
2255 | 2255 |
2256 /** Returns true if the context has experienced an out of memory situation. */ | 2256 /** Returns true if the context has experienced an out of memory situation. */ |
2257 bool HasOutOfMemoryException(); | 2257 bool HasOutOfMemoryException(); |
2258 | 2258 |
2259 /** Returns true if V8 has a current context. */ | 2259 /** Returns true if V8 has a current context. */ |
2260 static bool InContext(); | 2260 static bool InContext(); |
2261 | 2261 |
2262 /** | 2262 /** |
| 2263 * Associate an additional data object with the context. This is mainly used |
| 2264 * with the debugger to provide additional information on the context through |
| 2265 * the debugger API. |
| 2266 */ |
| 2267 void SetData(Handle<Value> data); |
| 2268 Local<Value> GetData(); |
| 2269 |
| 2270 /** |
2263 * Stack-allocated class which sets the execution context for all | 2271 * Stack-allocated class which sets the execution context for all |
2264 * operations executed within a local scope. | 2272 * operations executed within a local scope. |
2265 */ | 2273 */ |
2266 class V8EXPORT Scope { | 2274 class V8EXPORT Scope { |
2267 public: | 2275 public: |
2268 inline Scope(Handle<Context> context) : context_(context) { | 2276 inline Scope(Handle<Context> context) : context_(context) { |
2269 context_->Enter(); | 2277 context_->Enter(); |
2270 } | 2278 } |
2271 inline ~Scope() { context_->Exit(); } | 2279 inline ~Scope() { context_->Exit(); } |
2272 private: | 2280 private: |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 | 2574 |
2567 } // namespace v8 | 2575 } // namespace v8 |
2568 | 2576 |
2569 | 2577 |
2570 #undef V8EXPORT | 2578 #undef V8EXPORT |
2571 #undef V8EXPORT_INLINE | 2579 #undef V8EXPORT_INLINE |
2572 #undef TYPE_CHECK | 2580 #undef TYPE_CHECK |
2573 | 2581 |
2574 | 2582 |
2575 #endif // V8_H_ | 2583 #endif // V8_H_ |
OLD | NEW |