| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(g
etAfterCompileScript, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate); | 453 v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(g
etAfterCompileScript, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate); |
| 454 ASSERT(value->IsObject()); | 454 ASSERT(value->IsObject()); |
| 455 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value); | 455 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value); |
| 456 dispatchDidParseSource(listener, object); | 456 dispatchDidParseSource(listener, object); |
| 457 } else if (event == v8::Exception) { | 457 } else if (event == v8::Exception) { |
| 458 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackT
race(1); | 458 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackT
race(1); |
| 459 // Stack trace is empty in case of syntax error. Silently continue e
xecution in such cases. | 459 // Stack trace is empty in case of syntax error. Silently continue e
xecution in such cases. |
| 460 if (!stackTrace->GetFrameCount()) | 460 if (!stackTrace->GetFrameCount()) |
| 461 return; | 461 return; |
| 462 RefPtr<JavaScriptCallFrame> topFrame = wrapCallFrames(eventDetails.G
etExecutionState(), 1); | 462 RefPtr<JavaScriptCallFrame> topFrame = wrapCallFrames(eventDetails.G
etExecutionState(), 1); |
| 463 if (topFrame && executeSkipPauseRequest(listener->shouldSkipExceptio
nPause(topFrame), eventDetails.GetExecutionState())) { | 463 if (executeSkipPauseRequest(listener->shouldSkipExceptionPause(topFr
ame), eventDetails.GetExecutionState())) |
| 464 return; | 464 return; |
| 465 } | |
| 466 v8::Handle<v8::Object> eventData = eventDetails.GetEventData(); | 465 v8::Handle<v8::Object> eventData = eventDetails.GetEventData(); |
| 467 v8::Handle<v8::Value> exceptionGetterValue = eventData->Get(v8::Stri
ng::NewSymbol("exception")); | 466 v8::Handle<v8::Value> exceptionGetterValue = eventData->Get(v8::Stri
ng::NewSymbol("exception")); |
| 468 ASSERT(!exceptionGetterValue.IsEmpty() && exceptionGetterValue->IsFu
nction()); | 467 ASSERT(!exceptionGetterValue.IsEmpty() && exceptionGetterValue->IsFu
nction()); |
| 469 v8::Handle<v8::Value> exception = V8ScriptRunner::callInternalFuncti
on(v8::Handle<v8::Function>::Cast(exceptionGetterValue), eventData, 0, 0, m_isol
ate); | 468 v8::Handle<v8::Value> exception = V8ScriptRunner::callInternalFuncti
on(v8::Handle<v8::Function>::Cast(exceptionGetterValue), eventData, 0, 0, m_isol
ate); |
| 470 handleProgramBreak(eventDetails, exception, v8::Handle<v8::Array>())
; | 469 handleProgramBreak(eventDetails, exception, v8::Handle<v8::Array>())
; |
| 471 } else if (event == v8::Break) { | 470 } else if (event == v8::Break) { |
| 472 v8::Handle<v8::Function> getBreakpointNumbersFunction = v8::Local<v8
::Function>::Cast(debuggerScript->Get(v8::String::NewSymbol("getBreakpointNumber
s"))); | 471 v8::Handle<v8::Function> getBreakpointNumbersFunction = v8::Local<v8
::Function>::Cast(debuggerScript->Get(v8::String::NewSymbol("getBreakpointNumber
s"))); |
| 473 v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() }; | 472 v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() }; |
| 474 v8::Handle<v8::Value> hitBreakpoints = V8ScriptRunner::callInternalF
unction(getBreakpointNumbersFunction, debuggerScript, WTF_ARRAY_LENGTH(argv), ar
gv, m_isolate); | 473 v8::Handle<v8::Value> hitBreakpoints = V8ScriptRunner::callInternalF
unction(getBreakpointNumbersFunction, debuggerScript, WTF_ARRAY_LENGTH(argv), ar
gv, m_isolate); |
| 475 ASSERT(hitBreakpoints->IsArray()); | 474 ASSERT(hitBreakpoints->IsArray()); |
| 476 | |
| 477 RefPtr<JavaScriptCallFrame> topFrame = wrapCallFrames(eventDetails.G
etExecutionState(), 1); | 475 RefPtr<JavaScriptCallFrame> topFrame = wrapCallFrames(eventDetails.G
etExecutionState(), 1); |
| 478 if (topFrame) { | 476 ScriptDebugListener::SkipPauseRequest skipRequest; |
| 479 ScriptDebugListener::SkipPauseRequest skipRequest; | 477 if (v8::Handle<v8::Array>::Cast(hitBreakpoints)->Length()) |
| 480 if (v8::Handle<v8::Array>::Cast(hitBreakpoints)->Length()) | 478 skipRequest = listener->shouldSkipBreakpointPause(topFrame); |
| 481 skipRequest = listener->shouldSkipBreakpointPause(topFrame); | 479 else |
| 482 else | 480 skipRequest = listener->shouldSkipStepPause(topFrame); |
| 483 skipRequest = listener->shouldSkipStepPause(topFrame); | 481 if (executeSkipPauseRequest(skipRequest, eventDetails.GetExecutionSt
ate())) |
| 484 if (executeSkipPauseRequest(skipRequest, eventDetails.GetExecuti
onState())) | 482 return; |
| 485 return; | |
| 486 } | |
| 487 | |
| 488 handleProgramBreak(eventDetails, v8::Handle<v8::Value>(), hitBreakpo
ints.As<v8::Array>()); | 483 handleProgramBreak(eventDetails, v8::Handle<v8::Value>(), hitBreakpo
ints.As<v8::Array>()); |
| 489 } | 484 } |
| 490 } | 485 } |
| 491 } | 486 } |
| 492 | 487 |
| 493 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8
::Handle<v8::Object> object) | 488 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8
::Handle<v8::Object> object) |
| 494 { | 489 { |
| 495 String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::St
ring::NewSymbol("id"))); | 490 String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::St
ring::NewSymbol("id"))); |
| 496 | 491 |
| 497 ScriptDebugListener::Script script; | 492 ScriptDebugListener::Script script; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 { | 616 { |
| 622 return PassOwnPtr<ScriptSourceCode>(); | 617 return PassOwnPtr<ScriptSourceCode>(); |
| 623 } | 618 } |
| 624 | 619 |
| 625 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source,
const String& url, const String& functionName) | 620 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source,
const String& url, const String& functionName) |
| 626 { | 621 { |
| 627 return source; | 622 return source; |
| 628 } | 623 } |
| 629 | 624 |
| 630 } // namespace WebCore | 625 } // namespace WebCore |
| OLD | NEW |