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

Side by Side Diff: Source/devtools/front_end/bindings/SASSSourceMapping.js

Issue 1328843002: DevTools: introduce WI.SourceMap.Entry structure and cleanup WI.SourceMap API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix test 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 | Annotate | Revision Log
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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 } 548 }
549 }, 549 },
550 550
551 /** 551 /**
552 * @override 552 * @override
553 * @param {!WebInspector.CSSLocation} rawLocation 553 * @param {!WebInspector.CSSLocation} rawLocation
554 * @return {?WebInspector.UILocation} 554 * @return {?WebInspector.UILocation}
555 */ 555 */
556 rawLocationToUILocation: function(rawLocation) 556 rawLocationToUILocation: function(rawLocation)
557 { 557 {
558 var entry;
559 var sourceMap = this._sourceMapByStyleSheetURL[rawLocation.url]; 558 var sourceMap = this._sourceMapByStyleSheetURL[rawLocation.url];
560 if (!sourceMap) 559 if (!sourceMap)
561 return null; 560 return null;
562 entry = sourceMap.findEntry(rawLocation.lineNumber, rawLocation.columnNu mber); 561 var entry = sourceMap.findEntry(rawLocation.lineNumber, rawLocation.colu mnNumber);
563 if (!entry || entry.length === 2) 562 if (!entry || !entry.sourceURL)
564 return null; 563 return null;
565 var uiSourceCode = this._networkMapping.uiSourceCodeForURL(entry[2], raw Location.target()); 564 var uiSourceCode = this._networkMapping.uiSourceCodeForURL(entry.sourceU RL, rawLocation.target());
566 if (!uiSourceCode) 565 if (!uiSourceCode)
567 return null; 566 return null;
568 return uiSourceCode.uiLocation(entry[3], entry[4]); 567 return uiSourceCode.uiLocation(entry.sourceLineNumber, entry.sourceColum nNumber);
569 }, 568 },
570 569
571 /** 570 /**
572 * @override 571 * @override
573 * @param {!WebInspector.UISourceCode} uiSourceCode 572 * @param {!WebInspector.UISourceCode} uiSourceCode
574 * @param {number} lineNumber 573 * @param {number} lineNumber
575 * @param {number} columnNumber 574 * @param {number} columnNumber
576 * @return {?WebInspector.CSSLocation} 575 * @return {?WebInspector.CSSLocation}
577 */ 576 */
578 uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) 577 uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 this._cssURLsForSASSURL = {}; 646 this._cssURLsForSASSURL = {};
648 /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>} */ 647 /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>} */
649 this._pendingSourceMapLoadingCallbacks = {}; 648 this._pendingSourceMapLoadingCallbacks = {};
650 /** @type {!Object.<string, !{deadlineMs: number, dataByURL: !Object.<st ring, !{timer: number, previousPoll: number}>}>} */ 649 /** @type {!Object.<string, !{deadlineMs: number, dataByURL: !Object.<st ring, !{timer: number, previousPoll: number}>}>} */
651 this._pollDataForSASSURL = {}; 650 this._pollDataForSASSURL = {};
652 /** @type {!Object.<string, !WebInspector.SourceMap>} */ 651 /** @type {!Object.<string, !WebInspector.SourceMap>} */
653 this._sourceMapByURL = {}; 652 this._sourceMapByURL = {};
654 this._sourceMapByStyleSheetURL = {}; 653 this._sourceMapByStyleSheetURL = {};
655 } 654 }
656 } 655 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/bindings/CompilerScriptMapping.js ('k') | Source/devtools/front_end/sdk/SourceMap.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698