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

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

Issue 471433004: DevTools: Split out the "workspace" and "bindings" modules from "sdk" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove marker interfaces and WI.SourceMapping Created 6 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 | 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 var splitURL = sourceURL.substring(snippetPrefix.length).split("_"); 391 var splitURL = sourceURL.substring(snippetPrefix.length).split("_");
392 var snippetId = splitURL[0]; 392 var snippetId = splitURL[0];
393 return snippetId; 393 return snippetId;
394 }, 394 },
395 395
396 __proto__: WebInspector.Object.prototype 396 __proto__: WebInspector.Object.prototype
397 } 397 }
398 398
399 /** 399 /**
400 * @constructor 400 * @constructor
401 * @implements {WebInspector.ScriptSourceMapping} 401 * @implements {WebInspector.DebuggerSourceMapping}
402 * @param {!WebInspector.Target} target 402 * @param {!WebInspector.Target} target
403 * @param {!WebInspector.ScriptSnippetModel} scriptSnippetModel 403 * @param {!WebInspector.ScriptSnippetModel} scriptSnippetModel
404 */ 404 */
405 WebInspector.SnippetScriptMapping = function(target, scriptSnippetModel) 405 WebInspector.SnippetScriptMapping = function(target, scriptSnippetModel)
406 { 406 {
407 this._target = target; 407 this._target = target;
408 this._scriptSnippetModel = scriptSnippetModel; 408 this._scriptSnippetModel = scriptSnippetModel;
409 /** @type {!Object.<string, !WebInspector.UISourceCode>} */ 409 /** @type {!Object.<string, !WebInspector.UISourceCode>} */
410 this._uiSourceCodeForScriptId = {}; 410 this._uiSourceCodeForScriptId = {};
411 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.Script>} */ 411 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.Script>} */
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 }, 460 },
461 461
462 _reset: function() 462 _reset: function()
463 { 463 {
464 this._uiSourceCodeForScriptId = {}; 464 this._uiSourceCodeForScriptId = {};
465 this._scriptForUISourceCode.clear(); 465 this._scriptForUISourceCode.clear();
466 this._evaluationIndexForUISourceCode.clear(); 466 this._evaluationIndexForUISourceCode.clear();
467 }, 467 },
468 468
469 /** 469 /**
470 * @param {!WebInspector.RawLocation} rawLocation 470 * @param {!WebInspector.DebuggerModel.Location} rawLocation
471 * @return {?WebInspector.UILocation} 471 * @return {?WebInspector.UILocation}
472 */ 472 */
473 rawLocationToUILocation: function(rawLocation) 473 rawLocationToUILocation: function(rawLocation)
474 { 474 {
475 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat ion} */(rawLocation); 475 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat ion} */(rawLocation);
476 var uiSourceCode = this._uiSourceCodeForScriptId[debuggerModelLocation.s criptId]; 476 var uiSourceCode = this._uiSourceCodeForScriptId[debuggerModelLocation.s criptId];
477 if (!uiSourceCode) 477 if (!uiSourceCode)
478 return null; 478 return null;
479 479
480 return uiSourceCode.uiLocation(debuggerModelLocation.lineNumber, debugge rModelLocation.columnNumber || 0); 480 return uiSourceCode.uiLocation(debuggerModelLocation.lineNumber, debugge rModelLocation.columnNumber || 0);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 this._model.deleteScriptSnippet(path); 696 this._model.deleteScriptSnippet(path);
697 }, 697 },
698 698
699 __proto__: WebInspector.ContentProviderBasedProjectDelegate.prototype 699 __proto__: WebInspector.ContentProviderBasedProjectDelegate.prototype
700 } 700 }
701 701
702 /** 702 /**
703 * @type {!WebInspector.ScriptSnippetModel} 703 * @type {!WebInspector.ScriptSnippetModel}
704 */ 704 */
705 WebInspector.scriptSnippetModel; 705 WebInspector.scriptSnippetModel;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/bindings/SASSSourceMapping.js ('k') | Source/devtools/front_end/bindings/StylesSourceMapping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698