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

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

Issue 222143003: DevTools: Make ConsoleMessage TargetAware (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@console-cpp-exec-context
Patch Set: Rebase 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
« no previous file with comments | « Source/devtools/front_end/NetworkManager.js ('k') | no next file » | 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 if (!uiSourceCode || uiSourceCode._evaluationIndex !== evaluationInd ex) 216 if (!uiSourceCode || uiSourceCode._evaluationIndex !== evaluationInd ex)
217 return; 217 return;
218 218
219 if (error) { 219 if (error) {
220 console.error(error); 220 console.error(error);
221 return; 221 return;
222 } 222 }
223 223
224 if (!scriptId) { 224 if (!scriptId) {
225 var consoleMessage = new WebInspector.ConsoleMessage( 225 var consoleMessage = new WebInspector.ConsoleMessage(
226 WebInspector.console.target(),
226 WebInspector.ConsoleMessage.MessageSource.JS, 227 WebInspector.ConsoleMessage.MessageSource.JS,
227 WebInspector.ConsoleMessage.MessageLevel.Error, 228 WebInspector.ConsoleMessage.MessageLevel.Error,
228 syntaxErrorMessage || ""); 229 syntaxErrorMessage || "");
229 WebInspector.console.addMessage(consoleMessage); 230 WebInspector.console.addMessage(consoleMessage);
230 return; 231 return;
231 } 232 }
232 233
233 var breakpointLocations = this._removeBreakpoints(uiSourceCode); 234 var breakpointLocations = this._removeBreakpoints(uiSourceCode);
234 this._restoreBreakpoints(uiSourceCode, breakpointLocations); 235 this._restoreBreakpoints(uiSourceCode, breakpointLocations);
235 236
(...skipping 26 matching lines...) Expand all
262 } 263 }
263 }, 264 },
264 265
265 /** 266 /**
266 * @param {?RuntimeAgent.RemoteObject} result 267 * @param {?RuntimeAgent.RemoteObject} result
267 * @param {boolean=} wasThrown 268 * @param {boolean=} wasThrown
268 */ 269 */
269 _printRunScriptResult: function(result, wasThrown) 270 _printRunScriptResult: function(result, wasThrown)
270 { 271 {
271 var level = (wasThrown ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log); 272 var level = (wasThrown ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
272 var message = new WebInspector.ConsoleMessage( 273 var message = new WebInspector.ConsoleMessage(WebInspector.console.targe t(),
273 WebInspector.ConsoleMessage.MessageSource.JS, 274 WebInspector.ConsoleMessage.MessageSource.JS,
274 level, 275 level,
275 "", 276 "",
276 undefined, 277 undefined,
277 undefined, 278 undefined,
278 undefined, 279 undefined,
279 undefined, 280 undefined,
280 undefined, 281 undefined,
281 [result]); 282 [result]);
282 WebInspector.console.addMessage(message); 283 WebInspector.console.addMessage(message);
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 this._model.deleteScriptSnippet(path); 691 this._model.deleteScriptSnippet(path);
691 }, 692 },
692 693
693 __proto__: WebInspector.ContentProviderBasedProjectDelegate.prototype 694 __proto__: WebInspector.ContentProviderBasedProjectDelegate.prototype
694 } 695 }
695 696
696 /** 697 /**
697 * @type {!WebInspector.ScriptSnippetModel} 698 * @type {!WebInspector.ScriptSnippetModel}
698 */ 699 */
699 WebInspector.scriptSnippetModel; 700 WebInspector.scriptSnippetModel;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/NetworkManager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698