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

Side by Side Diff: Source/devtools/front_end/sdk/DebuggerModel.js

Issue 300393002: Merge DevTools Refactor CL to Blink36 (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1985
Patch Set: PTAL Created 6 years, 6 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 | Annotate | Revision Log
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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 callback(this.target().runtimeModel.createRemoteObject(result), !!wasThrown); 583 callback(this.target().runtimeModel.createRemoteObject(result), !!wasThrown);
584 584
585 if (objectGroup === "console") 585 if (objectGroup === "console")
586 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events. ConsoleCommandEvaluatedInSelectedCallFrame); 586 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events. ConsoleCommandEvaluatedInSelectedCallFrame);
587 } 587 }
588 588
589 this.selectedCallFrame().evaluate(code, objectGroup, includeCommandLineA PI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, didEva luate.bind(this)); 589 this.selectedCallFrame().evaluate(code, objectGroup, includeCommandLineA PI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, didEva luate.bind(this));
590 }, 590 },
591 591
592 /** 592 /**
593 * @param {function(!Object)} callback
594 */
595 getSelectedCallFrameVariables: function(callback)
596 {
597 var result = { this: true };
598
599 var selectedCallFrame = this._selectedCallFrame;
600 if (!selectedCallFrame)
601 callback(result);
602
603 var pendingRequests = 0;
604
605 function propertiesCollected(properties)
606 {
607 for (var i = 0; properties && i < properties.length; ++i)
608 result[properties[i].name] = true;
609 if (--pendingRequests == 0)
610 callback(result);
611 }
612
613 for (var i = 0; i < selectedCallFrame.scopeChain.length; ++i) {
614 var scope = selectedCallFrame.scopeChain[i];
615 // FIXMEDART: find a cleaner way of avoiding completing to all
616 // library names.
617 if (scope.type == "library")
618 continue;
619 var object = this.target().runtimeModel.createRemoteObject(scope.obj ect);
620 pendingRequests++;
621 object.getAllProperties(false, propertiesCollected);
622 }
623 },
624
625 /**
626 * @param {boolean} active 593 * @param {boolean} active
627 */ 594 */
628 setBreakpointsActive: function(active) 595 setBreakpointsActive: function(active)
629 { 596 {
630 if (this._breakpointsActive === active) 597 if (this._breakpointsActive === active)
631 return; 598 return;
632 this._breakpointsActive = active; 599 this._breakpointsActive = active;
633 this._agent.setBreakpointsActive(active); 600 this._agent.setBreakpointsActive(active);
634 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Breakpoi ntsActiveStateChanged, active); 601 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Breakpoi ntsActiveStateChanged, active);
635 }, 602 },
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 if (error) { 968 if (error) {
1002 console.error(error); 969 console.error(error);
1003 callback(null, false); 970 callback(null, false);
1004 return; 971 return;
1005 } 972 }
1006 callback(result, wasThrown); 973 callback(result, wasThrown);
1007 } 974 }
1008 this._debuggerAgent.evaluateOnCallFrame(this._payload.callFrameId, code, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, retur nByValue, generatePreview, didEvaluateOnCallFrame); 975 this._debuggerAgent.evaluateOnCallFrame(this._payload.callFrameId, code, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, retur nByValue, generatePreview, didEvaluateOnCallFrame);
1009 }, 976 },
1010 977
978 /* XXX add doccomment. */
979 getCompletions: function(code, callback)
980 {
981 this._debuggerAgent.getCompletionsOnCallFrame(this._payload.callFrameId, code, callback);
982 },
983
1011 /** 984 /**
1012 * @param {function(?Protocol.Error=)=} callback 985 * @param {function(?Protocol.Error=)=} callback
1013 */ 986 */
1014 restart: function(callback) 987 restart: function(callback)
1015 { 988 {
1016 /** 989 /**
1017 * @param {?Protocol.Error} error 990 * @param {?Protocol.Error} error
1018 * @param {!Array.<!DebuggerAgent.CallFrame>=} callFrames 991 * @param {!Array.<!DebuggerAgent.CallFrame>=} callFrames
1019 * @param {!Object=} details 992 * @param {!Object=} details
1020 * @param {!DebuggerAgent.StackTrace=} asyncStackTrace 993 * @param {!DebuggerAgent.StackTrace=} asyncStackTrace
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 this.asyncStackTrace.dispose(); 1103 this.asyncStackTrace.dispose();
1131 }, 1104 },
1132 1105
1133 __proto__: WebInspector.TargetAware.prototype 1106 __proto__: WebInspector.TargetAware.prototype
1134 } 1107 }
1135 1108
1136 /** 1109 /**
1137 * @type {!WebInspector.DebuggerModel} 1110 * @type {!WebInspector.DebuggerModel}
1138 */ 1111 */
1139 WebInspector.debuggerModel; 1112 WebInspector.debuggerModel;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/components/ObjectPropertiesSection.js ('k') | Source/devtools/front_end/sdk/RemoteObject.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698