| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 | 459 |
| 460 void InspectorDebuggerAgent::getBacktrace(ErrorString* errorString, RefPtr<Array
<CallFrame> >& callFrames, RefPtr<StackTrace>& asyncStackTrace) | 460 void InspectorDebuggerAgent::getBacktrace(ErrorString* errorString, RefPtr<Array
<CallFrame> >& callFrames, RefPtr<StackTrace>& asyncStackTrace) |
| 461 { | 461 { |
| 462 if (!assertPaused(errorString)) | 462 if (!assertPaused(errorString)) |
| 463 return; | 463 return; |
| 464 m_currentCallStack = scriptDebugServer().currentCallFrames(); | 464 m_currentCallStack = scriptDebugServer().currentCallFrames(); |
| 465 callFrames = currentCallFrames(); | 465 callFrames = currentCallFrames(); |
| 466 asyncStackTrace = currentAsyncStackTrace(); | 466 asyncStackTrace = currentAsyncStackTrace(); |
| 467 } | 467 } |
| 468 | 468 |
| 469 PassRefPtrWillBeRawPtr<JavaScriptCallFrame> InspectorDebuggerAgent::topCallFrame
SkipUnknownSources() |
| 470 { |
| 471 for (int index = 0; ; ++index) { |
| 472 RefPtrWillBeRawPtr<JavaScriptCallFrame> frame = scriptDebugServer().call
FrameNoScopes(index); |
| 473 if (!frame) |
| 474 return nullptr; |
| 475 String scriptIdString = String::number(frame->sourceID()); |
| 476 if (m_scripts.contains(scriptIdString)) |
| 477 return frame.release(); |
| 478 } |
| 479 } |
| 480 |
| 469 String InspectorDebuggerAgent::scriptURL(JavaScriptCallFrame* frame) | 481 String InspectorDebuggerAgent::scriptURL(JavaScriptCallFrame* frame) |
| 470 { | 482 { |
| 471 String scriptIdString = String::number(frame->sourceID()); | 483 String scriptIdString = String::number(frame->sourceID()); |
| 472 ScriptsMap::iterator it = m_scripts.find(scriptIdString); | 484 ScriptsMap::iterator it = m_scripts.find(scriptIdString); |
| 473 if (it == m_scripts.end()) | 485 if (it == m_scripts.end()) |
| 474 return String(); | 486 return String(); |
| 475 return it->value.url; | 487 return it->value.url; |
| 476 } | 488 } |
| 477 | 489 |
| 478 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipExceptio
nPause() | 490 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipExceptio
nPause() |
| 479 { | 491 { |
| 480 if (m_steppingFromFramework) | 492 if (m_steppingFromFramework) |
| 481 return ScriptDebugListener::NoSkip; | 493 return ScriptDebugListener::NoSkip; |
| 482 | 494 |
| 483 // FIXME: Fast return: if (!m_cachedSkipStackRegExp && !has_any_anti_breakpo
int) return ScriptDebugListener::NoSkip; | 495 // FIXME: Fast return: if (!m_cachedSkipStackRegExp && !has_any_anti_breakpo
int) return ScriptDebugListener::NoSkip; |
| 484 | 496 |
| 485 RefPtrWillBeRawPtr<JavaScriptCallFrame> topFrame = scriptDebugServer().topCa
llFrameNoScopes(); | 497 RefPtrWillBeRawPtr<JavaScriptCallFrame> topFrame = topCallFrameSkipUnknownSo
urces(); |
| 486 if (!topFrame) | 498 if (!topFrame) |
| 487 return ScriptDebugListener::NoSkip; | 499 return ScriptDebugListener::NoSkip; |
| 488 | 500 |
| 489 String topFrameScriptUrl = scriptURL(topFrame.get()); | 501 String topFrameScriptUrl = scriptURL(topFrame.get()); |
| 490 if (m_cachedSkipStackRegExp && !topFrameScriptUrl.isEmpty() && m_cachedSkipS
tackRegExp->match(topFrameScriptUrl) != -1) | 502 if (m_cachedSkipStackRegExp && !topFrameScriptUrl.isEmpty() && m_cachedSkipS
tackRegExp->match(topFrameScriptUrl) != -1) |
| 491 return ScriptDebugListener::Continue; | 503 return ScriptDebugListener::Continue; |
| 492 | 504 |
| 493 // Match against breakpoints. | 505 // Match against breakpoints. |
| 494 if (topFrameScriptUrl.isEmpty()) | 506 if (topFrameScriptUrl.isEmpty()) |
| 495 return ScriptDebugListener::NoSkip; | 507 return ScriptDebugListener::NoSkip; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 } | 540 } |
| 529 | 541 |
| 530 return ScriptDebugListener::NoSkip; | 542 return ScriptDebugListener::NoSkip; |
| 531 } | 543 } |
| 532 | 544 |
| 533 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipStepPaus
e() | 545 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipStepPaus
e() |
| 534 { | 546 { |
| 535 if (!m_cachedSkipStackRegExp || m_steppingFromFramework) | 547 if (!m_cachedSkipStackRegExp || m_steppingFromFramework) |
| 536 return ScriptDebugListener::NoSkip; | 548 return ScriptDebugListener::NoSkip; |
| 537 | 549 |
| 538 RefPtrWillBeRawPtr<JavaScriptCallFrame> topFrame = scriptDebugServer().topCa
llFrameNoScopes(); | 550 RefPtrWillBeRawPtr<JavaScriptCallFrame> topFrame = topCallFrameSkipUnknownSo
urces(); |
| 539 String scriptUrl = scriptURL(topFrame.get()); | 551 String scriptUrl = scriptURL(topFrame.get()); |
| 540 if (scriptUrl.isEmpty() || m_cachedSkipStackRegExp->match(scriptUrl) == -1) | 552 if (scriptUrl.isEmpty() || m_cachedSkipStackRegExp->match(scriptUrl) == -1) |
| 541 return ScriptDebugListener::NoSkip; | 553 return ScriptDebugListener::NoSkip; |
| 542 | 554 |
| 543 if (m_skippedStepInCount == 0) { | 555 if (m_skippedStepInCount == 0) { |
| 544 m_minFrameCountForSkip = scriptDebugServer().frameCount(); | 556 m_minFrameCountForSkip = scriptDebugServer().frameCount(); |
| 545 m_skippedStepInCount = 1; | 557 m_skippedStepInCount = 1; |
| 546 return ScriptDebugListener::StepInto; | 558 return ScriptDebugListener::StepInto; |
| 547 } | 559 } |
| 548 | 560 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 560 | 572 |
| 561 ++m_skippedStepInCount; | 573 ++m_skippedStepInCount; |
| 562 return ScriptDebugListener::StepInto; | 574 return ScriptDebugListener::StepInto; |
| 563 } | 575 } |
| 564 | 576 |
| 565 bool InspectorDebuggerAgent::isTopCallFrameInFramework() | 577 bool InspectorDebuggerAgent::isTopCallFrameInFramework() |
| 566 { | 578 { |
| 567 if (!m_cachedSkipStackRegExp) | 579 if (!m_cachedSkipStackRegExp) |
| 568 return false; | 580 return false; |
| 569 | 581 |
| 570 RefPtrWillBeRawPtr<JavaScriptCallFrame> topFrame = scriptDebugServer().topCa
llFrameNoScopes(); | 582 RefPtrWillBeRawPtr<JavaScriptCallFrame> topFrame = topCallFrameSkipUnknownSo
urces(); |
| 571 if (!topFrame) | 583 if (!topFrame) |
| 572 return false; | 584 return false; |
| 573 | 585 |
| 574 String scriptUrl = scriptURL(topFrame.get()); | 586 String scriptUrl = scriptURL(topFrame.get()); |
| 575 return !scriptUrl.isEmpty() && m_cachedSkipStackRegExp->match(scriptUrl) !=
-1; | 587 return !scriptUrl.isEmpty() && m_cachedSkipStackRegExp->match(scriptUrl) !=
-1; |
| 576 } | 588 } |
| 577 | 589 |
| 578 PassRefPtr<TypeBuilder::Debugger::Location> InspectorDebuggerAgent::resolveBreak
point(const String& breakpointId, const String& scriptId, const ScriptBreakpoint
& breakpoint, BreakpointSource source) | 590 PassRefPtr<TypeBuilder::Debugger::Location> InspectorDebuggerAgent::resolveBreak
point(const String& breakpointId, const String& scriptId, const ScriptBreakpoint
& breakpoint, BreakpointSource source) |
| 579 { | 591 { |
| 580 ScriptsMap::iterator scriptIterator = m_scripts.find(scriptId); | 592 ScriptsMap::iterator scriptIterator = m_scripts.find(scriptId); |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1432 | 1444 |
| 1433 void InspectorDebuggerAgent::trace(Visitor* visitor) | 1445 void InspectorDebuggerAgent::trace(Visitor* visitor) |
| 1434 { | 1446 { |
| 1435 visitor->trace(m_injectedScriptManager); | 1447 visitor->trace(m_injectedScriptManager); |
| 1436 visitor->trace(m_listener); | 1448 visitor->trace(m_listener); |
| 1437 InspectorBaseAgent::trace(visitor); | 1449 InspectorBaseAgent::trace(visitor); |
| 1438 } | 1450 } |
| 1439 | 1451 |
| 1440 } // namespace blink | 1452 } // namespace blink |
| 1441 | 1453 |
| OLD | NEW |