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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js

Issue 2198443004: [DevTools] Fix location.script().sourceURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 4 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 return new WebInspector.UILocation(stubUISourceCode, rawLocation.lin eNumber, rawLocation.columnNumber); 103 return new WebInspector.UILocation(stubUISourceCode, rawLocation.lin eNumber, rawLocation.columnNumber);
104 104
105 var sourceMap = this._sourceMapForScriptId.get(debuggerModelLocation.scr iptId); 105 var sourceMap = this._sourceMapForScriptId.get(debuggerModelLocation.scr iptId);
106 if (!sourceMap) 106 if (!sourceMap)
107 return null; 107 return null;
108 var lineNumber = debuggerModelLocation.lineNumber; 108 var lineNumber = debuggerModelLocation.lineNumber;
109 var columnNumber = debuggerModelLocation.columnNumber || 0; 109 var columnNumber = debuggerModelLocation.columnNumber || 0;
110 var entry = sourceMap.findEntry(lineNumber, columnNumber); 110 var entry = sourceMap.findEntry(lineNumber, columnNumber);
111 if (!entry || !entry.sourceURL) 111 if (!entry || !entry.sourceURL)
112 return null; 112 return null;
113 var uiSourceCode = this._networkMapping.uiSourceCodeForScriptURL(/** @ty pe {string} */ (entry.sourceURL), rawLocation.script()); 113 var script = rawLocation.script();
114 if (!script)
115 return null;
116 var uiSourceCode = this._networkMapping.uiSourceCodeForScriptURL(/** @ty pe {string} */ (entry.sourceURL), script);
114 if (!uiSourceCode) 117 if (!uiSourceCode)
115 return null; 118 return null;
116 return uiSourceCode.uiLocation(/** @type {number} */ (entry.sourceLineNu mber), /** @type {number} */ (entry.sourceColumnNumber)); 119 return uiSourceCode.uiLocation(/** @type {number} */ (entry.sourceLineNu mber), /** @type {number} */ (entry.sourceColumnNumber));
117 }, 120 },
118 121
119 /** 122 /**
120 * @override 123 * @override
121 * @param {!WebInspector.UISourceCode} uiSourceCode 124 * @param {!WebInspector.UISourceCode} uiSourceCode
122 * @param {number} lineNumber 125 * @param {number} lineNumber
123 * @param {number} columnNumber 126 * @param {number} columnNumber
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 this._sourceMapForScriptId.clear() 385 this._sourceMapForScriptId.clear()
383 this._scriptForSourceMap.clear(); 386 this._scriptForSourceMap.clear();
384 this._sourceMapForURL.clear(); 387 this._sourceMapForURL.clear();
385 }, 388 },
386 389
387 dispose: function() 390 dispose: function()
388 { 391 {
389 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); 392 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this);
390 } 393 }
391 } 394 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698