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

Side by Side Diff: Source/devtools/front_end/ScriptFormatterEditorAction.js

Issue 211243006: DevTools: fix pretty-print functionality for VM scripts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: pfeldman suggestion Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @implements {WebInspector.SourceMapping} 7 * @implements {WebInspector.SourceMapping}
8 * @param {!WebInspector.Workspace} workspace 8 * @param {!WebInspector.Workspace} workspace
9 * @param {!WebInspector.DebuggerModel} debuggerModel 9 * @param {!WebInspector.DebuggerModel} debuggerModel
10 */ 10 */
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 { 66 {
67 return false; 67 return false;
68 }, 68 },
69 69
70 /** 70 /**
71 * @param {!WebInspector.UISourceCode} uiSourceCode 71 * @param {!WebInspector.UISourceCode} uiSourceCode
72 * @return {!Array.<!WebInspector.Script>} 72 * @return {!Array.<!WebInspector.Script>}
73 */ 73 */
74 _scriptsForUISourceCode: function(uiSourceCode) 74 _scriptsForUISourceCode: function(uiSourceCode)
75 { 75 {
76 var isInlineScript; 76 if (uiSourceCode.contentType() === WebInspector.resourceTypes.Document)
77 switch (uiSourceCode.contentType()) { 77 return this._debuggerModel.scriptsForSourceURL(uiSourceCode.url);
vsevik 2014/03/26 09:02:34 Please keep the inline filter.
pfeldman 2014/03/26 09:24:37 But this does not add any value. Why would we?
78 case WebInspector.resourceTypes.Document: 78 if (uiSourceCode.contentType() === WebInspector.resourceTypes.Script) {
79 isInlineScript = true; 79 var rawLocation = uiSourceCode.uiLocationToRawLocation(0, 0);
80 break; 80 return rawLocation ? [this._debuggerModel.scriptForId(rawLocation.sc riptId)] : [];
aandrey 2014/03/25 19:33:54 can return [undefined]
pfeldman 2014/03/25 20:01:40 I don't think so - uiSourceCode here is using defa
81 case WebInspector.resourceTypes.Script:
82 isInlineScript = false;
83 break;
84 default:
85 return [];
86 } 81 }
87 var scripts = this._debuggerModel.scriptsForSourceURL(uiSourceCode.url); 82 return [];
88
89 function filterOutIncorrectInlineType(script)
90 {
91 return script.isInlineScript() === isInlineScript;
92 }
93
94 return scripts.filter(filterOutIncorrectInlineType);
95 }, 83 },
96 84
97 _init: function() 85 _init: function()
98 { 86 {
99 /** @type {!Map.<!WebInspector.Script, !WebInspector.UISourceCode>} */ 87 /** @type {!Map.<!WebInspector.Script, !WebInspector.UISourceCode>} */
100 this._uiSourceCodes = new Map(); 88 this._uiSourceCodes = new Map();
101 /** @type {!StringMap.<string>} */ 89 /** @type {!StringMap.<string>} */
102 this._formattedPaths = new StringMap(); 90 this._formattedPaths = new StringMap();
103 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.FormatterScri ptMapping.FormatData>} */ 91 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.FormatterScri ptMapping.FormatData>} */
104 this._formatData = new Map(); 92 this._formatData = new Map();
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 }, 368 },
381 369
382 /** 370 /**
383 * @param {!WebInspector.UISourceCode} uiSourceCode 371 * @param {!WebInspector.UISourceCode} uiSourceCode
384 */ 372 */
385 _discardFormattedUISourceCodeScript: function(uiSourceCode) 373 _discardFormattedUISourceCodeScript: function(uiSourceCode)
386 { 374 {
387 this._scriptMapping._discardFormattedUISourceCodeScript(uiSourceCode); 375 this._scriptMapping._discardFormattedUISourceCodeScript(uiSourceCode);
388 } 376 }
389 } 377 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698