Chromium Code Reviews| Index: include/v8-debug.h |
| =================================================================== |
| --- include/v8-debug.h (revision 4685) |
| +++ include/v8-debug.h (working copy) |
| @@ -144,6 +144,39 @@ |
| /** |
| + * An event details object passed to the debug event listener. |
| + */ |
| + class EventDetails { |
| + public: |
| + /** |
| + * Event type. |
| + */ |
| + virtual DebugEvent GetEvent() const = 0; |
| + |
| + /** |
| + * Access to execution state and event data of the debug event. Don't store |
| + * these cross callbacks as their content becomes invalid. |
| + */ |
| + virtual Handle<Object> GetExecutionState() const = 0; |
| + virtual Handle<Object> GetEventData() const = 0; |
| + |
| + /** |
| + * Get the context active when the debug event happened. Note this is not |
| + * the current active context as the JavaScript part of the debugger is |
| + * running in it's own context which is entered at this point. |
| + */ |
| + virtual Handle<Context> GetEventContext() const = 0; |
| + |
| + /** |
| + * Client data passed with the corresponding callbak whet it was registered. |
| + */ |
| + virtual Handle<Value> GetCallbackData() const = 0; |
| + |
| + virtual ~EventDetails() {} |
| + }; |
| + |
| + |
| + /** |
| * Debug event callback function. |
| * |
| * \param event the type of the debug event that triggered the callback |
| @@ -157,6 +190,15 @@ |
| Handle<Object> event_data, |
| Handle<Value> data); |
| + /** |
| + * Debug event callback function. |
| + * |
| + * \param event_details object providing information about the debug event |
| + * |
| + * A EventCallback2 does not take posession of the event data, |
|
Søren Thygesen Gjesse
2010/05/20 14:42:23
posession -> possession
yurys
2010/05/20 17:06:35
Done.
|
| + * and must not rely on the data persisting after the handler returns. |
| + */ |
| + typedef void (*EventCallback2)(const EventDetails& event_details); |
| /** |
| * Debug message callback function. |
| @@ -196,6 +238,8 @@ |
| // Set a C debug event listener. |
| static bool SetDebugEventListener(EventCallback that, |
| Handle<Value> data = Handle<Value>()); |
| + static bool SetDebugEventListener2(EventCallback2 that, |
| + Handle<Value> data = Handle<Value>()); |
| // Set a JavaScript debug event listener. |
| static bool SetDebugEventListener(v8::Handle<v8::Object> that, |