Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: include/v8-debug.h

Issue 87026: DevTools: Support eventless host message dispatching. (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Rebase Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 * asynchronous event. The debugger takes ownership of the data and will 117 * asynchronous event. The debugger takes ownership of the data and will
118 * delete it before dying even if there is no message handler. 118 * delete it before dying even if there is no message handler.
119 * A MessageHandler does not take posession of the message string, 119 * A MessageHandler does not take posession of the message string,
120 * and must not rely on the data persisting after the handler returns. 120 * and must not rely on the data persisting after the handler returns.
121 */ 121 */
122 typedef void (*MessageHandler)(const uint16_t* message, int length, 122 typedef void (*MessageHandler)(const uint16_t* message, int length,
123 ClientData* client_data); 123 ClientData* client_data);
124 124
125 /** 125 /**
126 * Debug host dispatch callback function. 126 * Debug host dispatch callback function.
127 *
128 * \param dispatch the dispatch value
129 * \param data the data value passed when registering the dispatch handler
130 */ 127 */
131 typedef void (*HostDispatchHandler)(ClientData* dispatch); 128 typedef void (*HostDispatchHandler)();
132
133 129
134 // Set a C debug event listener. 130 // Set a C debug event listener.
135 static bool SetDebugEventListener(EventCallback that, 131 static bool SetDebugEventListener(EventCallback that,
136 Handle<Value> data = Handle<Value>()); 132 Handle<Value> data = Handle<Value>());
137 133
138 // Set a JavaScript debug event listener. 134 // Set a JavaScript debug event listener.
139 static bool SetDebugEventListener(v8::Handle<v8::Object> that, 135 static bool SetDebugEventListener(v8::Handle<v8::Object> that,
140 Handle<Value> data = Handle<Value>()); 136 Handle<Value> data = Handle<Value>());
141 137
142 // Break execution of JavaScript. 138 // Break execution of JavaScript.
143 static void DebugBreak(); 139 static void DebugBreak();
144 140
145 // Message based interface. The message protocol is JSON. 141 // Message based interface. The message protocol is JSON.
146 static void SetMessageHandler(MessageHandler handler, 142 static void SetMessageHandler(MessageHandler handler,
147 bool message_handler_thread = true); 143 bool message_handler_thread = true);
148 static void SendCommand(const uint16_t* command, int length, 144 static void SendCommand(const uint16_t* command, int length,
149 ClientData* client_data = NULL); 145 ClientData* client_data = NULL);
150 146
151 // Dispatch interface. 147 // Dispatch interface.
152 static void SetHostDispatchHandler(HostDispatchHandler handler); 148 static void SetHostDispatchHandler(HostDispatchHandler handler,
153 static void SendHostDispatch(ClientData* dispatch); 149 int period = 100);
154 150
155 /** 151 /**
156 * Run a JavaScript function in the debugger. 152 * Run a JavaScript function in the debugger.
157 * \param fun the function to call 153 * \param fun the function to call
158 * \param data passed as second argument to the function 154 * \param data passed as second argument to the function
159 * With this call the debugger is entered and the function specified is called 155 * With this call the debugger is entered and the function specified is called
160 * with the execution state as the first argument. This makes it possible to 156 * with the execution state as the first argument. This makes it possible to
161 * get access to information otherwise not available during normal JavaScript 157 * get access to information otherwise not available during normal JavaScript
162 * execution e.g. details on stack frames. The following example show a 158 * execution e.g. details on stack frames. The following example show a
163 * JavaScript function which when passed to v8::Debug::Call will return the 159 * JavaScript function which when passed to v8::Debug::Call will return the
(...skipping 18 matching lines...) Expand all
182 }; 178 };
183 179
184 180
185 } // namespace v8 181 } // namespace v8
186 182
187 183
188 #undef EXPORT 184 #undef EXPORT
189 185
190 186
191 #endif // V8_DEBUG_H_ 187 #endif // V8_DEBUG_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698