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

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

Issue 464963002: DevTools: Make UISourceCode Target-agnostic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; 42 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding;
43 this._projectId = "liveedit:" + target.id(); 43 this._projectId = "liveedit:" + target.id();
44 this._projectDelegate = new WebInspector.DebuggerProjectDelegate(workspace, this._projectId, WebInspector.projectTypes.LiveEdit); 44 this._projectDelegate = new WebInspector.DebuggerProjectDelegate(workspace, this._projectId, WebInspector.projectTypes.LiveEdit);
45 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Glob alObjectCleared, this._debuggerReset, this); 45 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Glob alObjectCleared, this._debuggerReset, this);
46 this._debuggerReset(); 46 this._debuggerReset();
47 } 47 }
48 48
49 WebInspector.LiveEditSupport.prototype = { 49 WebInspector.LiveEditSupport.prototype = {
50 /** 50 /**
51 * @param {!WebInspector.UISourceCode} uiSourceCode 51 * @param {!WebInspector.UISourceCode} uiSourceCode
52 * @return {!WebInspector.UISourceCode} 52 * @return {?WebInspector.UISourceCode}
53 */ 53 */
54 uiSourceCodeForLiveEdit: function(uiSourceCode) 54 uiSourceCodeForLiveEdit: function(uiSourceCode)
55 { 55 {
56 var debuggerModelLocation = this._debuggerWorkspaceBinding.uiLocationToR awLocation(this.target(), uiSourceCode, 0, 0); 56 var debuggerModelLocation = this._debuggerWorkspaceBinding.uiLocationToR awLocation(this.target(), uiSourceCode, 0, 0);
57 if (!debuggerModelLocation)
58 return null;
57 var uiLocation = this._debuggerWorkspaceBinding.rawLocationToUILocation( debuggerModelLocation); 59 var uiLocation = this._debuggerWorkspaceBinding.rawLocationToUILocation( debuggerModelLocation);
58 60
59 // FIXME: Support live editing of scripts mapped to some file. 61 // FIXME: Support live editing of scripts mapped to some file.
60 if (uiLocation.uiSourceCode !== uiSourceCode) 62 if (uiLocation.uiSourceCode !== uiSourceCode)
61 return uiLocation.uiSourceCode; 63 return uiLocation.uiSourceCode;
62 64
63 var script = debuggerModelLocation.script(); 65 var script = debuggerModelLocation.script();
64 if (this._uiSourceCodeForScriptId[script.scriptId]) 66 if (this._uiSourceCodeForScriptId[script.scriptId])
65 return this._uiSourceCodeForScriptId[script.scriptId]; 67 return this._uiSourceCodeForScriptId[script.scriptId];
66 68
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 WebInspector.console.error(message); 151 WebInspector.console.error(message);
150 } else { 152 } else {
151 WebInspector.console.addMessage(WebInspector.UIString("Unknown LiveEdit error: %s; %s", JSON.stringify(errorData), error), warningLevel); 153 WebInspector.console.addMessage(WebInspector.UIString("Unknown LiveEdit error: %s; %s", JSON.stringify(errorData), error), warningLevel);
152 } 154 }
153 } 155 }
154 156
155 WebInspector.LiveEditSupport.logSuccess = function() 157 WebInspector.LiveEditSupport.logSuccess = function()
156 { 158 {
157 WebInspector.console.log(WebInspector.UIString("Recompilation and update suc ceeded.")); 159 WebInspector.console.log(WebInspector.UIString("Recompilation and update suc ceeded."));
158 } 160 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/DefaultScriptMapping.js ('k') | Source/devtools/front_end/sdk/ResourceScriptMapping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698