Changeset 25552 in webkit
- Timestamp:
- Sep 13, 2007 4:59:35 PM (17 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r25544 r25552 1 2007-09-13 Kevin McCullough <kmccullough@apple.com> 2 3 Reviewed by Tim. 4 5 - Moved isPaused into the JS for efficiency and simplicity. 6 7 * Drosera/DebuggerDocument.cpp: 8 (DebuggerDocument::DebuggerDocument): 9 (DebuggerDocument::pauseCallback): 10 (DebuggerDocument::resumeCallback): 11 (DebuggerDocument::isPaused): 12 (DebuggerDocument::staticFunctions): 13 * Drosera/DebuggerDocument.h: 14 * Drosera/console.js: 15 * Drosera/debugger.js: 16 * Drosera/mac/DebuggerClient.mm: 17 (-[DebuggerClient validateUserInterfaceItem:]): 18 1 19 2007-09-13 Sam Weinig <sam@webkit.org> 2 20 -
trunk/WebKitTools/Drosera/DebuggerDocument.cpp
r25524 r25552 40 40 41 41 DebuggerDocument::DebuggerDocument(DebuggerClient* debugger) 42 : m_paused(false) 43 , m_debuggerClient(debugger) 42 : m_debuggerClient(debugger) 44 43 { 45 44 ASSERT(m_debuggerClient); … … 87 86 } 88 87 89 JSValueRef DebuggerDocument::isPausedCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/)90 {91 DebuggerDocument* debuggerDocument = reinterpret_cast<DebuggerDocument*>(JSObjectGetPrivate(thisObject));92 return JSValueMakeBoolean(context, debuggerDocument->m_paused);93 }94 95 88 JSValueRef DebuggerDocument::pauseCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/) 96 89 { 97 90 DebuggerDocument* debuggerDocument = reinterpret_cast<DebuggerDocument*>(JSObjectGetPrivate(thisObject)); 98 91 99 debuggerDocument->m_paused = true;100 92 debuggerDocument->platformPause(); 101 93 return JSValueMakeUndefined(context); … … 105 97 { 106 98 DebuggerDocument* debuggerDocument = reinterpret_cast<DebuggerDocument*>(JSObjectGetPrivate(thisObject)); 107 debuggerDocument->m_paused = false;108 99 debuggerDocument->platformResume(); 109 100 return JSValueMakeUndefined(context); … … 202 193 203 194 //-- These are the calls into the JS. --// 195 196 bool DebuggerDocument::isPaused(JSContextRef context) const 197 { 198 JSObjectRef globalObject = JSContextGetGlobalObject(context); 199 JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithUTF8CString("isPaused")); 200 JSValueRef objectProperty = JSObjectGetProperty(context, globalObject, string.get(), 0); 201 return JSValueToBoolean(context, objectProperty); 202 } 204 203 205 204 void DebuggerDocument::updateFileSource(JSContextRef context, JSStringRef documentSource, JSStringRef url) … … 357 356 { "currentFunctionStack", DebuggerDocument::currentFunctionStackCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 358 357 { "evaluateScript", DebuggerDocument::evaluateScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 359 { "isPaused", DebuggerDocument::isPausedCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },360 358 { "localScopeVariableNamesForCallFrame", DebuggerDocument::localScopeVariableNamesForCallFrameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 361 359 { "pause", DebuggerDocument::pauseCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/WebKitTools/Drosera/DebuggerDocument.h
r25524 r25552 51 51 DebuggerDocument(DebuggerClient*); 52 52 53 // These are all calls out ofthe JS53 // These are all calls from the JS 54 54 static JSValueRef breakpointEditorHTMLCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); 55 static JSValueRef isPausedCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/);56 55 static JSValueRef pauseCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); 57 56 static JSValueRef resumeCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); … … 63 62 static JSValueRef logCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); 64 63 65 // Cross-platform functions64 // Non Cross-platform functions 66 65 void platformPause(); 67 66 void platformResume(); … … 74 73 75 74 // These are the calls into the JS. 75 bool isPaused(JSContextRef) const; 76 76 static void updateFileSource(JSContextRef, JSStringRef documentSource, JSStringRef url); 77 77 static void didParseScript(JSContextRef, JSStringRef source, JSStringRef documentSource, JSStringRef url, JSValueRef sourceId, JSValueRef baseLine); … … 90 90 static JSValueRef callGlobalFunction(JSContextRef, const char* functionName, int argumentCount, JSValueRef arguments[], JSValueRef* exception = 0); // Implementation for calls into JS 91 91 92 bool getPaused() const { return m_paused; }93 94 92 private: 95 93 static JSValueRef callFunctionOnObject(JSContextRef, JSObjectRef object, const char* functionName, int argumentCount, JSValueRef arguments[], JSValueRef* exception = 0); // Implementation for calls into JS … … 100 98 101 99 DebuggerClient* m_debuggerClient; //DebuggerClient owns the DebuggerDocument so don't delete it. It will delete you! 102 103 bool m_paused;104 100 }; 105 101 -
trunk/WebKitTools/Drosera/console.js
r25394 r25552 44 44 { 45 45 if (event.keyCode == 13 && !event.altKey) { 46 if (mainWindow.isPaused ()&& mainWindow.currentStack) {46 if (mainWindow.isPaused && mainWindow.currentStack) { 47 47 history[history.length - 1] = inputElement.innerText; 48 48 sendScript(inputElement.innerText); -
trunk/WebKitTools/Drosera/debugger.js
r25394 r25552 50 50 var breakpointEditorHTML = DebuggerDocument.breakpointEditorHTML(); 51 51 var pendingAction = null; 52 var isPaused = false; 52 53 53 54 ScriptCallFrame = function (functionName, index, row) … … 287 288 } 288 289 289 function isPaused()290 {291 return DebuggerDocument.isPaused();292 }293 294 290 function pause() 295 291 { 296 292 DebuggerDocument.pause(); 293 isPaused = true; 297 294 } 298 295 … … 318 315 319 316 DebuggerDocument.resume(); 317 isPaused = false; 320 318 } 321 319 … … 1351 1349 } 1352 1350 1353 if (isPaused ()) {1351 if (isPaused) { 1354 1352 updateFunctionStack(); 1355 1353 jumpToLine(sourceId, line); -
trunk/WebKitTools/Drosera/mac/DebuggerClient.mm
r25524 r25552 365 365 SEL action = [interfaceItem action]; 366 366 if (action == @selector(pause:)) { 367 return !debuggerDocument->getPaused(); 367 if (!webViewLoaded) 368 return NO; 369 370 return !debuggerDocument->isPaused([[webView mainFrame] globalContext]); 368 371 } 369 372 if (action == @selector(resume:) || … … 371 374 action == @selector(stepOut:) || 372 375 action == @selector(stepInto:)) { 373 return debuggerDocument->getPaused(); 376 if (!webViewLoaded) 377 return YES; 378 379 return debuggerDocument->isPaused([[webView mainFrame] globalContext]); 374 380 } 375 381 return YES;
Note: See TracChangeset
for help on using the changeset viewer.