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

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

Issue 1307363006: DevTools: move instrumentation of v8 calls into V8ScriptRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merged willCall and willEvaluate on V8DebuggerAgent Created 5 years, 3 months 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/inspector/V8DebuggerAgent.h" 6 #include "core/inspector/V8DebuggerAgent.h"
7 7
8 #include "bindings/core/v8/ScriptCallStackFactory.h" 8 #include "bindings/core/v8/ScriptCallStackFactory.h"
9 #include "bindings/core/v8/ScriptRegexp.h" 9 #include "bindings/core/v8/ScriptRegexp.h"
10 #include "bindings/core/v8/ScriptValue.h" 10 #include "bindings/core/v8/ScriptValue.h"
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 { 1358 {
1359 m_asyncCallTrackingListeners.add(listener); 1359 m_asyncCallTrackingListeners.add(listener);
1360 } 1360 }
1361 1361
1362 void V8DebuggerAgent::removeAsyncCallTrackingListener(AsyncCallTrackingListener* listener) 1362 void V8DebuggerAgent::removeAsyncCallTrackingListener(AsyncCallTrackingListener* listener)
1363 { 1363 {
1364 ASSERT(m_asyncCallTrackingListeners.contains(listener)); 1364 ASSERT(m_asyncCallTrackingListeners.contains(listener));
1365 m_asyncCallTrackingListeners.remove(listener); 1365 m_asyncCallTrackingListeners.remove(listener);
1366 } 1366 }
1367 1367
1368 void V8DebuggerAgent::willCallFunction(int scriptId) 1368 void V8DebuggerAgent::willCallFunction(int scriptId)
dgozman 2015/08/29 00:04:39 willExecuteScript
yurys 2015/08/29 00:14:24 Done.
1369 { 1369 {
1370 changeJavaScriptRecursionLevel(+1); 1370 changeJavaScriptRecursionLevel(+1);
1371 // Fast return. 1371 // Fast return.
1372 if (m_scheduledDebuggerStep != StepInto) 1372 if (m_scheduledDebuggerStep != StepInto)
1373 return; 1373 return;
1374 // Skip unknown scripts (e.g. InjectedScript). 1374 // Skip unknown scripts (e.g. InjectedScript).
1375 if (!m_scripts.contains(String::number(scriptId))) 1375 if (!m_scripts.contains(String::number(scriptId)))
1376 return; 1376 return;
1377 schedulePauseOnNextStatementIfSteppingInto(); 1377 schedulePauseOnNextStatementIfSteppingInto();
1378 } 1378 }
1379 1379
1380 void V8DebuggerAgent::didCallFunction() 1380 void V8DebuggerAgent::didCallFunction()
1381 { 1381 {
1382 changeJavaScriptRecursionLevel(-1); 1382 changeJavaScriptRecursionLevel(-1);
1383 } 1383 }
1384 1384
1385 void V8DebuggerAgent::willEvaluateScript()
1386 {
1387 changeJavaScriptRecursionLevel(+1);
1388 schedulePauseOnNextStatementIfSteppingInto();
1389 }
1390
1391 void V8DebuggerAgent::didEvaluateScript()
1392 {
1393 changeJavaScriptRecursionLevel(-1);
1394 }
1395
1396 void V8DebuggerAgent::changeJavaScriptRecursionLevel(int step) 1385 void V8DebuggerAgent::changeJavaScriptRecursionLevel(int step)
1397 { 1386 {
1398 if (m_javaScriptPauseScheduled && !m_skipAllPauses && !isPaused()) { 1387 if (m_javaScriptPauseScheduled && !m_skipAllPauses && !isPaused()) {
1399 // Do not ever loose user's pause request until we have actually paused. 1388 // Do not ever loose user's pause request until we have actually paused.
1400 debugger().setPauseOnNextStatement(true); 1389 debugger().setPauseOnNextStatement(true);
1401 } 1390 }
1402 if (m_scheduledDebuggerStep == StepOut) { 1391 if (m_scheduledDebuggerStep == StepOut) {
1403 m_recursionLevelForStepOut += step; 1392 m_recursionLevelForStepOut += step;
1404 if (!m_recursionLevelForStepOut) { 1393 if (!m_recursionLevelForStepOut) {
1405 // When StepOut crosses a task boundary (i.e. js -> blink_c++) from where it was requested, 1394 // When StepOut crosses a task boundary (i.e. js -> blink_c++) from where it was requested,
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 RefPtr<ExceptionDetails> exceptionDetails = ExceptionDetails::create().setTe xt(toCoreStringWithUndefinedOrNullCheck(message->Get())); 1693 RefPtr<ExceptionDetails> exceptionDetails = ExceptionDetails::create().setTe xt(toCoreStringWithUndefinedOrNullCheck(message->Get()));
1705 exceptionDetails->setLine(message->GetLineNumber()); 1694 exceptionDetails->setLine(message->GetLineNumber());
1706 exceptionDetails->setColumn(message->GetStartColumn()); 1695 exceptionDetails->setColumn(message->GetStartColumn());
1707 v8::Local<v8::StackTrace> messageStackTrace = message->GetStackTrace(); 1696 v8::Local<v8::StackTrace> messageStackTrace = message->GetStackTrace();
1708 if (!messageStackTrace.IsEmpty() && messageStackTrace->GetFrameCount() > 0) 1697 if (!messageStackTrace.IsEmpty() && messageStackTrace->GetFrameCount() > 0)
1709 exceptionDetails->setStackTrace(createScriptCallStack(isolate, messageSt ackTrace, messageStackTrace->GetFrameCount())->buildInspectorArray()); 1698 exceptionDetails->setStackTrace(createScriptCallStack(isolate, messageSt ackTrace, messageStackTrace->GetFrameCount())->buildInspectorArray());
1710 return exceptionDetails.release(); 1699 return exceptionDetails.release();
1711 } 1700 }
1712 1701
1713 } // namespace blink 1702 } // namespace blink
OLDNEW
« Source/core/inspector/PageDebuggerAgent.cpp ('K') | « Source/core/inspector/V8DebuggerAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698