| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 */ | 507 */ |
| 508 function eventListeners(fulfill, reject) | 508 function eventListeners(fulfill, reject) |
| 509 { | 509 { |
| 510 if (!this.target().hasDOMCapability()) { | 510 if (!this.target().hasDOMCapability()) { |
| 511 // TODO(kozyatinskiy): figure out how this should work for |wind
ow| when there is no DOMDebugger. | 511 // TODO(kozyatinskiy): figure out how this should work for |wind
ow| when there is no DOMDebugger. |
| 512 fulfill([]); | 512 fulfill([]); |
| 513 return; | 513 return; |
| 514 } | 514 } |
| 515 | 515 |
| 516 if (!this._objectId) { | 516 if (!this._objectId) { |
| 517 reject(null); | 517 reject(new Error("No object id specified")); |
| 518 return; | 518 return; |
| 519 } | 519 } |
| 520 | 520 |
| 521 this.target().domdebuggerAgent().getEventListeners(this._objectId, m
ycallback.bind(this)); | 521 this.target().domdebuggerAgent().getEventListeners(this._objectId, m
ycallback.bind(this)); |
| 522 | 522 |
| 523 /** | 523 /** |
| 524 * @this {WebInspector.RemoteObjectImpl} | 524 * @this {WebInspector.RemoteObjectImpl} |
| 525 * @param {?Protocol.Error} error | 525 * @param {?Protocol.Error} error |
| 526 * @param {!Array<!DOMDebuggerAgent.EventListener>} payloads | 526 * @param {!Array<!DOMDebuggerAgent.EventListener>} payloads |
| 527 */ | 527 */ |
| 528 function mycallback(error, payloads) | 528 function mycallback(error, payloads) |
| 529 { | 529 { |
| 530 if (error) { | 530 if (error) { |
| 531 reject(null); | 531 reject(new Error(error)); |
| 532 return; | 532 return; |
| 533 } | 533 } |
| 534 fulfill(payloads.map(createEventListener.bind(this))); | 534 fulfill(payloads.map(createEventListener.bind(this))); |
| 535 } | 535 } |
| 536 | 536 |
| 537 /** | 537 /** |
| 538 * @this {WebInspector.RemoteObjectImpl} | 538 * @this {WebInspector.RemoteObjectImpl} |
| 539 * @param {!DOMDebuggerAgent.EventListener} payload | 539 * @param {!DOMDebuggerAgent.EventListener} payload |
| 540 */ | 540 */ |
| 541 function createEventListener(payload) | 541 function createEventListener(payload) |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 }, | 1510 }, |
| 1511 | 1511 |
| 1512 /** | 1512 /** |
| 1513 * @return {!WebInspector.RemoteObject} | 1513 * @return {!WebInspector.RemoteObject} |
| 1514 */ | 1514 */ |
| 1515 object: function() | 1515 object: function() |
| 1516 { | 1516 { |
| 1517 return this._object; | 1517 return this._object; |
| 1518 } | 1518 } |
| 1519 } | 1519 } |
| OLD | NEW |