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

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

Issue 220903002: DevTools: wrap DebuggerAgent.Location with DebuggerModel.Location. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: All tests!!! Created 6 years, 8 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 | « Source/devtools/front_end/Linkifier.js ('k') | Source/devtools/front_end/Main.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 30 matching lines...) Expand all
41 41
42 WebInspector.LiveEditSupport.prototype = { 42 WebInspector.LiveEditSupport.prototype = {
43 /** 43 /**
44 * @param {!WebInspector.UISourceCode} uiSourceCode 44 * @param {!WebInspector.UISourceCode} uiSourceCode
45 * @return {!WebInspector.UISourceCode} 45 * @return {!WebInspector.UISourceCode}
46 */ 46 */
47 uiSourceCodeForLiveEdit: function(uiSourceCode) 47 uiSourceCodeForLiveEdit: function(uiSourceCode)
48 { 48 {
49 var rawLocation = uiSourceCode.uiLocationToRawLocation(0, 0); 49 var rawLocation = uiSourceCode.uiLocationToRawLocation(0, 0);
50 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat ion} */ (rawLocation); 50 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat ion} */ (rawLocation);
51 var script = WebInspector.debuggerModel.scriptForId(debuggerModelLocatio n.scriptId); 51 var script = debuggerModelLocation.script();
52 var uiLocation = script.rawLocationToUILocation(0, 0); 52 var uiLocation = script.rawLocationToUILocation(0, 0);
53 53
54 // FIXME: Support live editing of scripts mapped to some file. 54 // FIXME: Support live editing of scripts mapped to some file.
55 if (uiLocation.uiSourceCode !== uiSourceCode) 55 if (uiLocation.uiSourceCode !== uiSourceCode)
56 return uiLocation.uiSourceCode; 56 return uiLocation.uiSourceCode;
57 if (this._uiSourceCodeForScriptId[script.scriptId]) 57 if (this._uiSourceCodeForScriptId[script.scriptId])
58 return this._uiSourceCodeForScriptId[script.scriptId]; 58 return this._uiSourceCodeForScriptId[script.scriptId];
59 59
60 console.assert(!script.isInlineScript()); 60 console.assert(!script.isInlineScript());
61 var liveEditUISourceCode = this._workspaceProvider.addUniqueFileForURL(s cript.sourceURL, script, true, script.isContentScript); 61 var liveEditUISourceCode = this._workspaceProvider.addUniqueFileForURL(s cript.sourceURL, script, true, script.isContentScript);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 checkMapping: function() 170 checkMapping: function()
171 { 171 {
172 }, 172 },
173 173
174 __proto__: WebInspector.Object.prototype 174 __proto__: WebInspector.Object.prototype
175 } 175 }
176 176
177 /** @type {!WebInspector.LiveEditSupport} */ 177 /** @type {!WebInspector.LiveEditSupport} */
178 WebInspector.liveEditSupport; 178 WebInspector.liveEditSupport;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/Linkifier.js ('k') | Source/devtools/front_end/Main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698