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

Side by Side Diff: Source/core/inspector/InspectorDebuggerAgent.cpp

Issue 60203007: DevTools: Fix disabling all pauses on reload. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed Created 7 years, 1 month 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 | « Source/bindings/v8/ScriptDebugServer.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010-2011 Google Inc. All rights reserved. 3 * Copyright (C) 2010-2011 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 ScriptsMap::iterator it = m_scripts.find(scriptIdString); 456 ScriptsMap::iterator it = m_scripts.find(scriptIdString);
457 if (it == m_scripts.end()) 457 if (it == m_scripts.end())
458 return String(); 458 return String();
459 return it->value.url; 459 return it->value.url;
460 } 460 }
461 461
462 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipExceptio nPause(RefPtr<JavaScriptCallFrame>& topFrame) 462 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipExceptio nPause(RefPtr<JavaScriptCallFrame>& topFrame)
463 { 463 {
464 if (m_skipAllPauses) 464 if (m_skipAllPauses)
465 return ScriptDebugListener::Continue; 465 return ScriptDebugListener::Continue;
466 if (!topFrame)
467 return ScriptDebugListener::NoSkip;
466 468
467 String topFrameScriptUrl = scriptURL(topFrame.get()); 469 String topFrameScriptUrl = scriptURL(topFrame.get());
468 if (m_cachedSkipStackRegExp && !topFrameScriptUrl.isEmpty() && m_cachedSkipS tackRegExp->match(topFrameScriptUrl) != -1) 470 if (m_cachedSkipStackRegExp && !topFrameScriptUrl.isEmpty() && m_cachedSkipS tackRegExp->match(topFrameScriptUrl) != -1)
469 return ScriptDebugListener::Continue; 471 return ScriptDebugListener::Continue;
470 472
471 // Prepare top frame parameters;
472 int topFrameLineNumber = topFrame->line();
473 int topFrameColumnNumber = topFrame->column();
474
475 // Match against breakpoints. 473 // Match against breakpoints.
476 if (topFrameScriptUrl.isEmpty()) 474 if (topFrameScriptUrl.isEmpty())
477 return ScriptDebugListener::NoSkip; 475 return ScriptDebugListener::NoSkip;
478 476
477 // Prepare top frame parameters.
478 int topFrameLineNumber = topFrame->line();
479 int topFrameColumnNumber = topFrame->column();
480
479 RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState ::javaScriptBreakpoints); 481 RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState ::javaScriptBreakpoints);
480 for (JSONObject::iterator it = breakpointsCookie->begin(); it != breakpoints Cookie->end(); ++it) { 482 for (JSONObject::iterator it = breakpointsCookie->begin(); it != breakpoints Cookie->end(); ++it) {
481 RefPtr<JSONObject> breakpointObject = it->value->asObject(); 483 RefPtr<JSONObject> breakpointObject = it->value->asObject();
482 bool isAntibreakpoint; 484 bool isAntibreakpoint;
483 breakpointObject->getBoolean(DebuggerAgentState::isAnti, &isAntibreakpoi nt); 485 breakpointObject->getBoolean(DebuggerAgentState::isAnti, &isAntibreakpoi nt);
484 if (!isAntibreakpoint) 486 if (!isAntibreakpoint)
485 continue; 487 continue;
486 488
487 int breakLineNumber; 489 int breakLineNumber;
488 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakLineNu mber); 490 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakLineNu mber);
(...skipping 16 matching lines...) Expand all
505 return ScriptDebugListener::Continue; 507 return ScriptDebugListener::Continue;
506 } 508 }
507 509
508 return ScriptDebugListener::NoSkip; 510 return ScriptDebugListener::NoSkip;
509 } 511 }
510 512
511 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipBreakpoi ntPause(RefPtr<JavaScriptCallFrame>& topFrame) 513 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipBreakpoi ntPause(RefPtr<JavaScriptCallFrame>& topFrame)
512 { 514 {
513 if (m_skipAllPauses) 515 if (m_skipAllPauses)
514 return ScriptDebugListener::Continue; 516 return ScriptDebugListener::Continue;
517 if (!topFrame)
518 return ScriptDebugListener::NoSkip;
515 return ScriptDebugListener::NoSkip; 519 return ScriptDebugListener::NoSkip;
516 } 520 }
517 521
518 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipStepPaus e(RefPtr<JavaScriptCallFrame>& topFrame) 522 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipStepPaus e(RefPtr<JavaScriptCallFrame>& topFrame)
519 { 523 {
520 if (m_skipAllPauses) 524 if (m_skipAllPauses)
521 return ScriptDebugListener::Continue; 525 return ScriptDebugListener::Continue;
526 if (!topFrame)
527 return ScriptDebugListener::NoSkip;
522 528
523 if (m_cachedSkipStackRegExp) { 529 if (m_cachedSkipStackRegExp) {
524 String scriptUrl = scriptURL(topFrame.get()); 530 String scriptUrl = scriptURL(topFrame.get());
525 if (!scriptUrl.isEmpty() && m_cachedSkipStackRegExp->match(scriptUrl) != -1) { 531 if (!scriptUrl.isEmpty() && m_cachedSkipStackRegExp->match(scriptUrl) != -1) {
526 if (m_skipStepInCount > 0) { 532 if (m_skipStepInCount > 0) {
527 --m_skipStepInCount; 533 --m_skipStepInCount;
528 return ScriptDebugListener::StepInto; 534 return ScriptDebugListener::StepInto;
529 } 535 }
530 return ScriptDebugListener::StepOut; 536 return ScriptDebugListener::StepOut;
531 } 537 }
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 m_frontend->resumed(); 1024 m_frontend->resumed();
1019 } 1025 }
1020 1026
1021 bool InspectorDebuggerAgent::canBreakProgram() 1027 bool InspectorDebuggerAgent::canBreakProgram()
1022 { 1028 {
1023 return scriptDebugServer().canBreakProgram(); 1029 return scriptDebugServer().canBreakProgram();
1024 } 1030 }
1025 1031
1026 void InspectorDebuggerAgent::breakProgram(InspectorFrontend::Debugger::Reason::E num breakReason, PassRefPtr<JSONObject> data) 1032 void InspectorDebuggerAgent::breakProgram(InspectorFrontend::Debugger::Reason::E num breakReason, PassRefPtr<JSONObject> data)
1027 { 1033 {
1034 if (m_skipAllPauses)
1035 return;
1028 m_breakReason = breakReason; 1036 m_breakReason = breakReason;
1029 m_breakAuxData = data; 1037 m_breakAuxData = data;
1030 scriptDebugServer().breakProgram(); 1038 scriptDebugServer().breakProgram();
1031 } 1039 }
1032 1040
1033 void InspectorDebuggerAgent::clear() 1041 void InspectorDebuggerAgent::clear()
1034 { 1042 {
1035 m_pausedScriptState = 0; 1043 m_pausedScriptState = 0;
1036 m_currentCallStack = ScriptValue(); 1044 m_currentCallStack = ScriptValue();
1037 m_scripts.clear(); 1045 m_scripts.clear();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 void InspectorDebuggerAgent::reset() 1081 void InspectorDebuggerAgent::reset()
1074 { 1082 {
1075 m_scripts.clear(); 1083 m_scripts.clear();
1076 m_breakpointIdToDebugServerBreakpointIds.clear(); 1084 m_breakpointIdToDebugServerBreakpointIds.clear();
1077 if (m_frontend) 1085 if (m_frontend)
1078 m_frontend->globalObjectCleared(); 1086 m_frontend->globalObjectCleared();
1079 } 1087 }
1080 1088
1081 } // namespace WebCore 1089 } // namespace WebCore
1082 1090
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptDebugServer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698