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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js

Issue 1826623002: [DevTools] Move wrapCallFrames from InjectedScriptSource.js to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-no-scopes
Patch Set: Created 4 years, 9 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 var funcMirror; 417 var funcMirror;
418 var location; 418 var location;
419 var scopeStartLocations; 419 var scopeStartLocations;
420 var scopeEndLocations; 420 var scopeEndLocations;
421 421
422 function createLocation(script, pos) 422 function createLocation(script, pos)
423 { 423 {
424 if (!script) 424 if (!script)
425 return null; 425 return null;
426 426
427 location = script.locationFromPosition(pos, true); 427 var location = script.locationFromPosition(pos, true);
dgozman 2016/03/23 00:12:35 What a fix! Nice!
428 return { 428 return {
429 "lineNumber": location.line, 429 "lineNumber": location.line,
430 "columnNumber": location.column, 430 "columnNumber": location.column,
431 "scriptId": String(script.id()) 431 "scriptId": String(script.id())
432 } 432 }
433 } 433 }
434 434
435 function lazyScopeChain() 435 function lazyScopeChain()
436 { 436 {
437 if (!scopeChain) { 437 if (!scopeChain) {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 function restart() 564 function restart()
565 { 565 {
566 return frameMirror.restart(); 566 return frameMirror.restart();
567 } 567 }
568 568
569 function setVariableValue(scopeNumber, variableName, newValue) 569 function setVariableValue(scopeNumber, variableName, newValue)
570 { 570 {
571 return DebuggerScript._setScopeVariableValue(frameMirror, scopeNumber, v ariableName, newValue); 571 return DebuggerScript._setScopeVariableValue(frameMirror, scopeNumber, v ariableName, newValue);
572 } 572 }
573 573
574 function stepInPositions()
575 {
576 var stepInPositionsV8 = frameMirror.stepInPositions();
577 var stepInPositionsProtocol;
578 if (stepInPositionsV8) {
579 stepInPositionsProtocol = [];
580 var script = ensureFuncMirror().script();
581 if (script) {
582 var scriptId = String(script.id());
583 for (var i = 0; i < stepInPositionsV8.length; i++) {
584 var item = {
585 scriptId: scriptId,
586 lineNumber: stepInPositionsV8[i].position.line,
587 columnNumber: stepInPositionsV8[i].position.column
588 };
589 stepInPositionsProtocol.push(item);
590 }
591 }
592 }
593 return JSON.stringify(stepInPositionsProtocol);
594 }
595
596 return { 574 return {
597 "sourceID": sourceID, 575 "sourceID": sourceID,
598 "line": line, 576 "line": line,
599 "column": column, 577 "column": column,
600 "scriptName": scriptName, 578 "scriptName": scriptName,
601 "functionName": functionName, 579 "functionName": functionName,
602 "functionLine": functionLine, 580 "functionLine": functionLine,
603 "functionColumn": functionColumn, 581 "functionColumn": functionColumn,
604 "thisObject": thisObject, 582 "thisObject": thisObject,
605 "scopeChain": lazyScopeChain, 583 "scopeChain": lazyScopeChain,
606 "scopeType": lazyScopeTypes, 584 "scopeType": lazyScopeTypes,
607 "scopeName": lazyScopeNames, 585 "scopeName": lazyScopeNames,
608 "scopeStartLocation": lazyScopeStartLocations, 586 "scopeStartLocation": lazyScopeStartLocations,
609 "scopeEndLocation": lazyScopeEndLocations, 587 "scopeEndLocation": lazyScopeEndLocations,
610 "evaluate": evaluate, 588 "evaluate": evaluate,
611 "caller": callerFrame, 589 "caller": callerFrame,
612 "restart": restart, 590 "restart": restart,
613 "setVariableValue": setVariableValue, 591 "setVariableValue": setVariableValue,
614 "stepInPositions": stepInPositions,
615 "isAtReturn": isAtReturn, 592 "isAtReturn": isAtReturn,
616 "returnValue": returnValue 593 "returnValue": returnValue
617 }; 594 };
618 } 595 }
619 596
620 DebuggerScript._buildScopeObject = function(scopeType, scopeObject) 597 DebuggerScript._buildScopeObject = function(scopeType, scopeObject)
621 { 598 {
622 var result; 599 var result;
623 switch (scopeType) { 600 switch (scopeType) {
624 case ScopeType.Local: 601 case ScopeType.Local:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 "parentPromise": eventData.parentPromise().value(), 635 "parentPromise": eventData.parentPromise().value(),
659 "status": eventData.status() 636 "status": eventData.status()
660 }; 637 };
661 } 638 }
662 639
663 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr ors in the cache we disable it. 640 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr ors in the cache we disable it.
664 ToggleMirrorCache(false); 641 ToggleMirrorCache(false);
665 642
666 return DebuggerScript; 643 return DebuggerScript;
667 })(); 644 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698