| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (normalResult->IsObject()) | 291 if (normalResult->IsObject()) |
| 292 *result = ScriptObject(ScriptState::current(), normalResult->ToO
bject()); | 292 *result = ScriptObject(ScriptState::current(), normalResult->ToO
bject()); |
| 293 // Call stack may have changed after if the edited function was on t
he stack. | 293 // Call stack may have changed after if the edited function was on t
he stack. |
| 294 if (!preview && isPaused()) | 294 if (!preview && isPaused()) |
| 295 *newCallFrames = currentCallFrames(); | 295 *newCallFrames = currentCallFrames(); |
| 296 return true; | 296 return true; |
| 297 } | 297 } |
| 298 // Compile error. | 298 // Compile error. |
| 299 case 1: | 299 case 1: |
| 300 { | 300 { |
| 301 V8StringResource<WithUndefinedOrNullCheck> message(resultTuple->Get(
2)); |
| 302 if (!message.prepare()) { |
| 303 *error = "Unknown error."; |
| 304 return false; |
| 305 } |
| 301 RefPtr<TypeBuilder::Debugger::SetScriptSourceError::CompileError> co
mpileError = | 306 RefPtr<TypeBuilder::Debugger::SetScriptSourceError::CompileError> co
mpileError = |
| 302 TypeBuilder::Debugger::SetScriptSourceError::CompileError::creat
e() | 307 TypeBuilder::Debugger::SetScriptSourceError::CompileError::creat
e() |
| 303 .setMessage(toWebCoreStringWithUndefinedOrNullCheck(resultTu
ple->Get(2))) | 308 .setMessage(message) |
| 304 .setLineNumber(resultTuple->Get(3)->ToInteger()->Value()) | 309 .setLineNumber(resultTuple->Get(3)->ToInteger()->Value()) |
| 305 .setColumnNumber(resultTuple->Get(4)->ToInteger()->Value()); | 310 .setColumnNumber(resultTuple->Get(4)->ToInteger()->Value()); |
| 306 | 311 |
| 307 *error = toWebCoreStringWithUndefinedOrNullCheck(resultTuple->Get(1)
); | 312 V8StringResource<WithUndefinedOrNullCheck> errorResource(resultTuple
->Get(1)); |
| 313 if (!errorResource.prepare()) { |
| 314 *error = "Unknown error."; |
| 315 return false; |
| 316 } |
| 317 *error = errorResource; |
| 308 errorData = TypeBuilder::Debugger::SetScriptSourceError::create(); | 318 errorData = TypeBuilder::Debugger::SetScriptSourceError::create(); |
| 309 errorData->setCompileError(compileError); | 319 errorData->setCompileError(compileError); |
| 310 return false; | 320 return false; |
| 311 } | 321 } |
| 312 } | 322 } |
| 313 *error = "Unknown error."; | 323 *error = "Unknown error."; |
| 314 return false; | 324 return false; |
| 315 } | 325 } |
| 316 | 326 |
| 317 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(v8::Handle<v8:
:Object> executionState, int maximumLimit) | 327 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(v8::Handle<v8:
:Object> executionState, int maximumLimit) |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 if (isPaused()) | 387 if (isPaused()) |
| 378 return; | 388 return; |
| 379 | 389 |
| 380 ScriptDebugListener* listener = getDebugListenerForContext(m_pausedContext); | 390 ScriptDebugListener* listener = getDebugListenerForContext(m_pausedContext); |
| 381 if (!listener) | 391 if (!listener) |
| 382 return; | 392 return; |
| 383 | 393 |
| 384 Vector<String> breakpointIds; | 394 Vector<String> breakpointIds; |
| 385 if (!hitBreakpointNumbers.IsEmpty()) { | 395 if (!hitBreakpointNumbers.IsEmpty()) { |
| 386 breakpointIds.resize(hitBreakpointNumbers->Length()); | 396 breakpointIds.resize(hitBreakpointNumbers->Length()); |
| 387 for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) | 397 for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) { |
| 388 breakpointIds[i] = toWebCoreStringWithUndefinedOrNullCheck(hitBreakp
ointNumbers->Get(i)); | 398 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedO
rNullCheck>, hitBreakpointNumber, hitBreakpointNumbers->Get(i)); |
| 399 breakpointIds[i] = hitBreakpointNumber; |
| 400 } |
| 389 } | 401 } |
| 390 | 402 |
| 391 m_executionState.set(m_isolate, executionState); | 403 m_executionState.set(m_isolate, executionState); |
| 392 ScriptState* currentCallFrameState = ScriptState::forContext(m_pausedContext
); | 404 ScriptState* currentCallFrameState = ScriptState::forContext(m_pausedContext
); |
| 393 listener->didPause(currentCallFrameState, currentCallFrames(), ScriptValue(e
xception, currentCallFrameState->isolate()), breakpointIds); | 405 listener->didPause(currentCallFrameState, currentCallFrames(), ScriptValue(e
xception, currentCallFrameState->isolate()), breakpointIds); |
| 394 | 406 |
| 395 m_runningNestedMessageLoop = true; | 407 m_runningNestedMessageLoop = true; |
| 396 runMessageLoopOnPause(m_pausedContext); | 408 runMessageLoopOnPause(m_pausedContext); |
| 397 m_runningNestedMessageLoop = false; | 409 m_runningNestedMessageLoop = false; |
| 398 } | 410 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 skipRequest = listener->shouldSkipStepPause(topFrame); | 494 skipRequest = listener->shouldSkipStepPause(topFrame); |
| 483 if (executeSkipPauseRequest(skipRequest, eventDetails.GetExecutionSt
ate())) | 495 if (executeSkipPauseRequest(skipRequest, eventDetails.GetExecutionSt
ate())) |
| 484 return; | 496 return; |
| 485 handleProgramBreak(eventDetails, v8::Handle<v8::Value>(), hitBreakpo
ints.As<v8::Array>()); | 497 handleProgramBreak(eventDetails, v8::Handle<v8::Value>(), hitBreakpo
ints.As<v8::Array>()); |
| 486 } | 498 } |
| 487 } | 499 } |
| 488 } | 500 } |
| 489 | 501 |
| 490 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8
::Handle<v8::Object> object) | 502 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8
::Handle<v8::Object> object) |
| 491 { | 503 { |
| 492 String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8Atom
icString(m_isolate, "id"))); | 504 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe
ck>, sourceID, object->Get(v8AtomicString(m_isolate, "id"))); |
| 493 | 505 |
| 494 ScriptDebugListener::Script script; | 506 ScriptDebugListener::Script script; |
| 495 script.url = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicStr
ing(m_isolate, "name"))); | 507 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe
ck>, url, object->Get(v8AtomicString(m_isolate, "name"))); |
| 496 script.source = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8Atomic
String(m_isolate, "source"))); | 508 script.url = url; |
| 497 script.sourceMappingURL = toWebCoreStringWithUndefinedOrNullCheck(object->Ge
t(v8AtomicString(m_isolate, "sourceMappingURL"))); | 509 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe
ck>, source, object->Get(v8AtomicString(m_isolate, "source"))); |
| 510 script.source = source; |
| 511 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe
ck>, sourceMappingURL, object->Get(v8AtomicString(m_isolate, "sourceMappingURL")
)); |
| 512 script.sourceMappingURL = sourceMappingURL; |
| 498 script.startLine = object->Get(v8AtomicString(m_isolate, "startLine"))->ToIn
teger()->Value(); | 513 script.startLine = object->Get(v8AtomicString(m_isolate, "startLine"))->ToIn
teger()->Value(); |
| 499 script.startColumn = object->Get(v8AtomicString(m_isolate, "startColumn"))->
ToInteger()->Value(); | 514 script.startColumn = object->Get(v8AtomicString(m_isolate, "startColumn"))->
ToInteger()->Value(); |
| 500 script.endLine = object->Get(v8AtomicString(m_isolate, "endLine"))->ToIntege
r()->Value(); | 515 script.endLine = object->Get(v8AtomicString(m_isolate, "endLine"))->ToIntege
r()->Value(); |
| 501 script.endColumn = object->Get(v8AtomicString(m_isolate, "endColumn"))->ToIn
teger()->Value(); | 516 script.endColumn = object->Get(v8AtomicString(m_isolate, "endColumn"))->ToIn
teger()->Value(); |
| 502 script.isContentScript = object->Get(v8AtomicString(m_isolate, "isContentScr
ipt"))->ToBoolean()->Value(); | 517 script.isContentScript = object->Get(v8AtomicString(m_isolate, "isContentScr
ipt"))->ToBoolean()->Value(); |
| 503 | 518 |
| 504 listener->didParseSource(sourceID, script); | 519 listener->didParseSource(sourceID, script); |
| 505 } | 520 } |
| 506 | 521 |
| 507 void ScriptDebugServer::ensureDebuggerScriptCompiled() | 522 void ScriptDebugServer::ensureDebuggerScriptCompiled() |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 { | 633 { |
| 619 return PassOwnPtr<ScriptSourceCode>(); | 634 return PassOwnPtr<ScriptSourceCode>(); |
| 620 } | 635 } |
| 621 | 636 |
| 622 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source,
const String& url, const String& functionName) | 637 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source,
const String& url, const String& functionName) |
| 623 { | 638 { |
| 624 return source; | 639 return source; |
| 625 } | 640 } |
| 626 | 641 |
| 627 } // namespace WebCore | 642 } // namespace WebCore |
| OLD | NEW |