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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js

Issue 2645723002: [DevTools] use command line API during selection evaluation in console (Closed)
Patch Set: addressed comments Created 3 years, 11 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 | third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 {name: 'blockedEvent', threshold: 100}, {name: 'blockedParser', thresh old: -1}, 56 {name: 'blockedEvent', threshold: 100}, {name: 'blockedParser', thresh old: -1},
57 {name: 'handler', threshold: 150}, {name: 'recurringHandler', threshol d: 50} 57 {name: 'handler', threshold: 150}, {name: 'recurringHandler', threshol d: 50}
58 ]); 58 ]);
59 } 59 }
60 } 60 }
61 } 61 }
62 62
63 /** 63 /**
64 * @param {!SDK.ExecutionContext} executionContext 64 * @param {!SDK.ExecutionContext} executionContext
65 * @param {string} text 65 * @param {string} text
66 * @param {boolean=} useCommandLineAPI 66 * @param {boolean} useCommandLineAPI
67 */ 67 */
68 static evaluateCommandInConsole(executionContext, text, useCommandLineAPI) { 68 static evaluateCommandInConsole(executionContext, text, useCommandLineAPI) {
69 var target = executionContext.target(); 69 var target = executionContext.target();
70 var requestedText = text; 70 var requestedText = text;
71 71
72 var commandMessage = new SDK.ConsoleMessage( 72 var commandMessage = new SDK.ConsoleMessage(
73 target, SDK.ConsoleMessage.MessageSource.JS, null, text, SDK.ConsoleMess age.MessageType.Command); 73 target, SDK.ConsoleMessage.MessageSource.JS, null, text, SDK.ConsoleMess age.MessageType.Command);
74 commandMessage.setExecutionContextId(executionContext.id); 74 commandMessage.setExecutionContextId(executionContext.id);
75 target.consoleModel.addMessage(commandMessage); 75 target.consoleModel.addMessage(commandMessage);
76 76
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 return true; 110 return true;
111 } catch (e) { 111 } catch (e) {
112 return false; 112 return false;
113 } 113 }
114 } 114 }
115 115
116 if (looksLikeAnObjectLiteral(text)) 116 if (looksLikeAnObjectLiteral(text))
117 text = '(' + text + ')'; 117 text = '(' + text + ')';
118 118
119 executionContext.evaluate(text, 'console', !!useCommandLineAPI, false, false , true, true, printResult); 119 executionContext.evaluate(text, 'console', useCommandLineAPI, false, false, true, true, printResult);
120 Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConsoleEvaluated); 120 Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConsoleEvaluated);
121 } 121 }
122 122
123 /** 123 /**
124 * @param {!SDK.ConsoleMessage} msg 124 * @param {!SDK.ConsoleMessage} msg
125 */ 125 */
126 addMessage(msg) { 126 addMessage(msg) {
127 if (this._isBlacklisted(msg)) 127 if (this._isBlacklisted(msg))
128 return; 128 return;
129 129
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 */ 639 */
640 _commandEvaluated(event) { 640 _commandEvaluated(event) {
641 this.dispatchEventToListeners(SDK.ConsoleModel.Events.CommandEvaluated, even t.data); 641 this.dispatchEventToListeners(SDK.ConsoleModel.Events.CommandEvaluated, even t.data);
642 } 642 }
643 }; 643 };
644 644
645 /** 645 /**
646 * @type {!SDK.MultitargetConsoleModel} 646 * @type {!SDK.MultitargetConsoleModel}
647 */ 647 */
648 SDK.multitargetConsoleModel; 648 SDK.multitargetConsoleModel;
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698