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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js

Issue 1888813003: [DevTools] Move InjectedScript.lastResult to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp ('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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 * @param {!Object|symbol} object 412 * @param {!Object|symbol} object
413 * @param {string=} objectGroupName 413 * @param {string=} objectGroupName
414 * @return {string} 414 * @return {string}
415 */ 415 */
416 _bind: function(object, objectGroupName) 416 _bind: function(object, objectGroupName)
417 { 417 {
418 var id = InjectedScriptHost.bind(object, objectGroupName || ""); 418 var id = InjectedScriptHost.bind(object, objectGroupName || "");
419 return "{\"injectedScriptId\":" + injectedScriptId + ",\"id\":" + id + " }"; 419 return "{\"injectedScriptId\":" + injectedScriptId + ",\"id\":" + id + " }";
420 }, 420 },
421 421
422 clearLastEvaluationResult: function()
423 {
424 delete this._lastResult;
425 },
426
427 /**
428 * @param {*} result
429 */
430 setLastEvaluationResult: function(result)
431 {
432 this._lastResult = result;
433 },
434
435 /** 422 /**
436 * @param {!Object} object 423 * @param {!Object} object
437 * @param {string} objectGroupName 424 * @param {string} objectGroupName
438 * @param {boolean} ownProperties 425 * @param {boolean} ownProperties
439 * @param {boolean} accessorPropertiesOnly 426 * @param {boolean} accessorPropertiesOnly
440 * @param {boolean} generatePreview 427 * @param {boolean} generatePreview
441 * @return {!Array<!RuntimeAgent.PropertyDescriptor>|boolean} 428 * @return {!Array<!RuntimeAgent.PropertyDescriptor>|boolean}
442 */ 429 */
443 getProperties: function(object, objectGroupName, ownProperties, accessorProp ertiesOnly, generatePreview) 430 getProperties: function(object, objectGroupName, ownProperties, accessorProp ertiesOnly, generatePreview)
444 { 431 {
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 for (var i = 0; i < CommandLineAPI.members_.length; ++i) { 1165 for (var i = 0; i < CommandLineAPI.members_.length; ++i) {
1179 var member = CommandLineAPI.members_[i]; 1166 var member = CommandLineAPI.members_[i];
1180 this[member] = bind(commandLineAPIImpl[member], commandLineAPIImpl); 1167 this[member] = bind(commandLineAPIImpl[member], commandLineAPIImpl);
1181 this[member].toString = customToStringMethod(member); 1168 this[member].toString = customToStringMethod(member);
1182 } 1169 }
1183 1170
1184 for (var i = 0; i < 5; ++i) { 1171 for (var i = 0; i < 5; ++i) {
1185 var member = "$" + i; 1172 var member = "$" + i;
1186 this[member] = bind(commandLineAPIImpl._inspectedObject, commandLineAPII mpl, i); 1173 this[member] = bind(commandLineAPIImpl._inspectedObject, commandLineAPII mpl, i);
1187 } 1174 }
1188
1189 this.$_ = injectedScript._lastResult;
1190
1191 this.__proto__ = null; 1175 this.__proto__ = null;
1192 } 1176 }
1193 1177
1194 // NOTE: Please keep the list of API methods below synchronized to that in WebIn spector.RuntimeModel 1178 // NOTE: Please keep the list of API methods below synchronized to that in WebIn spector.RuntimeModel
1195 // and V8InjectedScriptHost! 1179 // and V8InjectedScriptHost!
1196 // NOTE: Argument names of these methods will be printed in the console, so use pretty names! 1180 // NOTE: Argument names of these methods will be printed in the console, so use pretty names!
1197 /** 1181 /**
1198 * @type {!Array.<string>} 1182 * @type {!Array.<string>}
1199 * @const 1183 * @const
1200 */ 1184 */
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 */ 1483 */
1500 _logEvent: function(event) 1484 _logEvent: function(event)
1501 { 1485 {
1502 inspectedGlobalObject.console.log(event.type, event); 1486 inspectedGlobalObject.console.log(event.type, event);
1503 } 1487 }
1504 } 1488 }
1505 1489
1506 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 1490 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
1507 return injectedScript; 1491 return injectedScript;
1508 }) 1492 })
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698