Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 /** | 88 /** |
| 89 * @param {boolean} accessorPropertiesOnly | 89 * @param {boolean} accessorPropertiesOnly |
| 90 * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!We bInspector.RemoteObjectProperty>)} callback | 90 * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!We bInspector.RemoteObjectProperty>)} callback |
| 91 */ | 91 */ |
| 92 getAllProperties: function(accessorPropertiesOnly, callback) | 92 getAllProperties: function(accessorPropertiesOnly, callback) |
| 93 { | 93 { |
| 94 throw "Not implemented"; | 94 throw "Not implemented"; |
| 95 }, | 95 }, |
| 96 | 96 |
| 97 /** | 97 /** |
| 98 * @param {function(?Array<!WebInspector.EventListener>)} callback | 98 * @return {!Promise<?Array<!WebInspector.EventListener>>} |
| 99 */ | 99 */ |
| 100 getEventListeners: function(callback) | 100 getEventListeners: function() |
| 101 { | 101 { |
| 102 throw "Not implemented"; | 102 throw "Not implemented"; |
| 103 }, | 103 }, |
| 104 | 104 |
| 105 /** | 105 /** |
| 106 * @param {!RuntimeAgent.CallArgument} name | 106 * @param {!RuntimeAgent.CallArgument} name |
| 107 * @param {function(string=)} callback | 107 * @param {function(string=)} callback |
| 108 */ | 108 */ |
| 109 deleteProperty: function(name, callback) | 109 deleteProperty: function(name, callback) |
| 110 { | 110 { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 384 * @param {boolean} accessorPropertiesOnly | 384 * @param {boolean} accessorPropertiesOnly |
| 385 * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!We bInspector.RemoteObjectProperty>)} callback | 385 * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!We bInspector.RemoteObjectProperty>)} callback |
| 386 */ | 386 */ |
| 387 getAllProperties: function(accessorPropertiesOnly, callback) | 387 getAllProperties: function(accessorPropertiesOnly, callback) |
| 388 { | 388 { |
| 389 this.doGetProperties(false, accessorPropertiesOnly, false, callback); | 389 this.doGetProperties(false, accessorPropertiesOnly, false, callback); |
| 390 }, | 390 }, |
| 391 | 391 |
| 392 /** | 392 /** |
| 393 * @override | 393 * @override |
| 394 * @param {function(?Array<!WebInspector.EventListener>)} callback | 394 * @return {!Promise<?Array<!WebInspector.EventListener>>} |
| 395 */ | 395 */ |
| 396 getEventListeners: function(callback) | 396 getEventListeners: function() |
| 397 { | 397 { |
| 398 if (!this._objectId) { | 398 return new Promise(getEventListeners.bind(this)); |
| 399 callback(null); | |
| 400 return; | |
| 401 } | |
| 402 /** | 399 /** |
| 403 * @this {!WebInspector.RemoteObject} | 400 * @param {function(?)} fulfill |
| 404 * @param {?Protocol.Error} error | 401 * @param {function(*)} reject |
| 405 * @param {!Array<!DOMDebuggerAgent.EventListener>} payloads | 402 * @this {WebInspector.RemoteObject} |
| 406 */ | 403 */ |
| 407 function mycallback(error, payloads) | 404 function getEventListeners(fulfill, reject) |
| 408 { | 405 { |
| 409 if (error) { | 406 if (!this._objectId) { |
| 410 callback(null); | 407 reject(null); |
| 411 return; | 408 return; |
| 412 } | 409 } |
| 413 callback(payloads.map(createEventListener.bind(this))); | 410 /** |
| 411 * @this {!WebInspector.RemoteObject} | |
| 412 * @param {?Protocol.Error} error | |
| 413 * @param {!Array<!DOMDebuggerAgent.EventListener>} payloads | |
| 414 */ | |
| 415 function mycallback(error, payloads) | |
| 416 { | |
| 417 if (error) { | |
| 418 reject(null); | |
| 419 return; | |
| 420 } | |
| 421 fulfill(payloads.map(createEventListener.bind(this))); | |
| 422 } | |
| 423 /** | |
| 424 * @this {!WebInspector.RemoteObject} | |
| 425 * @param {!DOMDebuggerAgent.EventListener} payload | |
| 426 */ | |
| 427 function createEventListener(payload) | |
| 428 { | |
| 429 return new WebInspector.EventListener(this._debuggerModel, paylo ad, this._objectId); | |
| 430 } | |
| 431 this.target().domdebuggerAgent().getEventListeners(this._objectId, m ycallback.bind(this)); | |
|
pfeldman
2015/05/25 16:25:16
move to line 410
kozy
2015/05/25 18:03:31
Done.
| |
| 414 } | 432 } |
| 415 /** | |
| 416 * @this {!WebInspector.RemoteObject} | |
| 417 * @param {!DOMDebuggerAgent.EventListener} payload | |
| 418 */ | |
| 419 function createEventListener(payload) | |
| 420 { | |
| 421 return new WebInspector.EventListener(this._debuggerModel, payload, this._objectId); | |
| 422 } | |
| 423 this.target().domdebuggerAgent().getEventListeners(this._objectId, mycal lback.bind(this)); | |
| 424 }, | 433 }, |
| 425 | 434 |
| 426 /** | 435 /** |
| 427 * @param {!Array.<string>} propertyPath | 436 * @param {!Array.<string>} propertyPath |
| 428 * @param {function(?WebInspector.RemoteObject, boolean=)} callback | 437 * @param {function(?WebInspector.RemoteObject, boolean=)} callback |
| 429 */ | 438 */ |
| 430 getProperty: function(propertyPath, callback) | 439 getProperty: function(propertyPath, callback) |
| 431 { | 440 { |
| 432 /** | 441 /** |
| 433 * @param {string} arrayStr | 442 * @param {string} arrayStr |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1214 { | 1223 { |
| 1215 if (!this._cachedDescription) { | 1224 if (!this._cachedDescription) { |
| 1216 var children = this._children(); | 1225 var children = this._children(); |
| 1217 this._cachedDescription = "{" + this._formatValue(children[0].value) + " => " + this._formatValue(children[1].value) + "}"; | 1226 this._cachedDescription = "{" + this._formatValue(children[0].value) + " => " + this._formatValue(children[1].value) + "}"; |
| 1218 } | 1227 } |
| 1219 return this._cachedDescription; | 1228 return this._cachedDescription; |
| 1220 }, | 1229 }, |
| 1221 | 1230 |
| 1222 __proto__: WebInspector.LocalJSONObject.prototype | 1231 __proto__: WebInspector.LocalJSONObject.prototype |
| 1223 } | 1232 } |
| OLD | NEW |