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

Side by Side Diff: WebCore/inspector/front-end/ScriptsPanel.js

Issue 6528009: Reverting poor merge of http://trac.webkit.org/changeset/74261 that landed in... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: '' Created 9 years, 10 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
« no previous file with comments | « no previous file | WebCore/inspector/front-end/SourceFrame.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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 { 238 {
239 var script = new WebInspector.Script(sourceID, sourceURL, source, starti ngLine, errorLine, errorMessage, scriptWorldType); 239 var script = new WebInspector.Script(sourceID, sourceURL, source, starti ngLine, errorLine, errorMessage, scriptWorldType);
240 this._sourceIDMap[sourceID] = script; 240 this._sourceIDMap[sourceID] = script;
241 241
242 var resource = WebInspector.resourceForURL(sourceURL); 242 var resource = WebInspector.resourceForURL(sourceURL);
243 if (resource) { 243 if (resource) {
244 if (resource.finished) { 244 if (resource.finished) {
245 // Resource is finished, bind the script right away. 245 // Resource is finished, bind the script right away.
246 resource.addScript(script); 246 resource.addScript(script);
247 this._sourceIDMap[sourceID] = resource; 247 this._sourceIDMap[sourceID] = resource;
248 var view = WebInspector.ResourceManager.existingResourceViewForR esource(resource);
249 if (view && view.sourceFrame)
250 view.sourceFrame.addScript(script);
251 } else { 248 } else {
252 // Resource is not finished, bind the script later. 249 // Resource is not finished, bind the script later.
253 if (!resource._scriptsPendingResourceLoad) { 250 if (!resource._scriptsPendingResourceLoad) {
254 resource._scriptsPendingResourceLoad = []; 251 resource._scriptsPendingResourceLoad = [];
255 resource.addEventListener("finished", this._resourceLoadingF inished, this); 252 resource.addEventListener("finished", this._resourceLoadingF inished, this);
256 } 253 }
257 resource._scriptsPendingResourceLoad.push(script); 254 resource._scriptsPendingResourceLoad.push(script);
258 } 255 }
259 } 256 }
260 this._addScriptToFilesMenu(script); 257 this._addScriptToFilesMenu(script);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 { 305 {
309 return Preferences.canEditScriptSource; 306 return Preferences.canEditScriptSource;
310 }, 307 },
311 308
312 editScriptSource: function(editData, commitEditingCallback, cancelEditingCal lback) 309 editScriptSource: function(editData, commitEditingCallback, cancelEditingCal lback)
313 { 310 {
314 if (!this.canEditScripts()) 311 if (!this.canEditScripts())
315 return; 312 return;
316 313
317 // Need to clear breakpoints and re-create them later when editing sourc e. 314 // Need to clear breakpoints and re-create them later when editing sourc e.
318 var breakpoints = WebInspector.breakpointManager.breakpointsForSourceID( sourceID); 315 var breakpoints = WebInspector.breakpointManager.breakpointsForSourceID( editData.sourceID);
319 for (var i = 0; i < breakpoints.length; ++i) 316 for (var i = 0; i < breakpoints.length; ++i)
320 breakpoints[i].remove(); 317 breakpoints[i].remove();
321 318
322 function mycallback(success, newBodyOrErrorMessage, callFrames) 319 function mycallback(success, newBodyOrErrorMessage, callFrames)
323 { 320 {
324 if (success) { 321 if (success) {
325 commitEditingCallback(newBodyOrErrorMessage); 322 commitEditingCallback(newBodyOrErrorMessage);
326 if (callFrames && callFrames.length) 323 if (callFrames && callFrames.length)
327 this.debuggerPaused(callFrames); 324 this.debuggerPaused(callFrames);
328 } else { 325 } else {
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 showGoToLineDialog: function(e) 1090 showGoToLineDialog: function(e)
1094 { 1091 {
1095 var view = this.visibleView; 1092 var view = this.visibleView;
1096 if (view) 1093 if (view)
1097 WebInspector.GoToLineDialog.show(view); 1094 WebInspector.GoToLineDialog.show(view);
1098 } 1095 }
1099 } 1096 }
1100 1097
1101 WebInspector.ScriptsPanel.prototype.__proto__ = WebInspector.Panel.prototype; 1098 WebInspector.ScriptsPanel.prototype.__proto__ = WebInspector.Panel.prototype;
1102 1099
OLDNEW
« no previous file with comments | « no previous file | WebCore/inspector/front-end/SourceFrame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698