Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 | 355 |
| 356 /** | 356 /** |
| 357 * @param {string} objectId | 357 * @param {string} objectId |
| 358 * @return {!Object} | 358 * @return {!Object} |
| 359 */ | 359 */ |
| 360 _parseObjectId: function(objectId) | 360 _parseObjectId: function(objectId) |
| 361 { | 361 { |
| 362 return nullifyObjectProto(/** @type {!Object} */ (InjectedScriptHost.eva l("(" + objectId + ")"))); | 362 return nullifyObjectProto(/** @type {!Object} */ (InjectedScriptHost.eva l("(" + objectId + ")"))); |
| 363 }, | 363 }, |
| 364 | 364 |
| 365 clearLastEvaluationResult: function() | 365 clearLastEvaluationResult: function() |
|
dgozman
2015/02/27 07:56:56
Is this one used? Remove it too?
pfeldman
2015/02/27 08:00:20
This one is used in injectedscriptnative.
aandrey
2015/02/27 08:01:54
This is called from native.
| |
| 366 { | 366 { |
| 367 delete this._lastResult; | 367 delete this._lastResult; |
| 368 }, | 368 }, |
| 369 | 369 |
| 370 /** | 370 /** |
| 371 * @param {string} objectId | |
| 372 */ | |
| 373 setLastEvaluationResult: function(objectId) | |
| 374 { | |
| 375 var parsedObjectId = this._parseObjectId(objectId); | |
| 376 var object = this._objectForId(parsedObjectId); | |
| 377 this._lastResult = object; | |
| 378 }, | |
| 379 | |
| 380 /** | |
| 381 * @param {string} methodName | 371 * @param {string} methodName |
| 382 * @param {string} args | 372 * @param {string} args |
| 383 * @return {*} | 373 * @return {*} |
| 384 */ | 374 */ |
| 385 dispatch: function(methodName, args) | 375 dispatch: function(methodName, args) |
| 386 { | 376 { |
| 387 var argsArray = /** @type {!Array.<*>} */ (InjectedScriptHost.eval("(" + args + ")")); | 377 var argsArray = /** @type {!Array.<*>} */ (InjectedScriptHost.eval("(" + args + ")")); |
| 388 var result = InjectedScriptHost.callFunction(this[methodName], this, arg sArray); | 378 var result = InjectedScriptHost.callFunction(this[methodName], this, arg sArray); |
| 389 if (typeof result === "undefined") { | 379 if (typeof result === "undefined") { |
| 390 inspectedWindow.console.error("Web Inspector error: InjectedScript.% s returns undefined", methodName); | 380 inspectedWindow.console.error("Web Inspector error: InjectedScript.% s returns undefined", methodName); |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1923 */ | 1913 */ |
| 1924 _logEvent: function(event) | 1914 _logEvent: function(event) |
| 1925 { | 1915 { |
| 1926 inspectedWindow.console.log(event.type, event); | 1916 inspectedWindow.console.log(event.type, event); |
| 1927 } | 1917 } |
| 1928 } | 1918 } |
| 1929 | 1919 |
| 1930 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); | 1920 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); |
| 1931 return injectedScript; | 1921 return injectedScript; |
| 1932 }) | 1922 }) |
| OLD | NEW |