| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 } | 486 } |
| 487 completionsReadyCallback(results); | 487 completionsReadyCallback(results); |
| 488 }, | 488 }, |
| 489 | 489 |
| 490 __proto__: WebInspector.SDKObject.prototype | 490 __proto__: WebInspector.SDKObject.prototype |
| 491 } | 491 } |
| 492 | 492 |
| 493 /** | 493 /** |
| 494 * @constructor | 494 * @constructor |
| 495 * @extends {WebInspector.SDKObject} | 495 * @extends {WebInspector.SDKObject} |
| 496 * @param {!WebInspector.Target} target |
| 497 * @param {string} type |
| 498 * @param {boolean} useCapture |
| 499 * @param {!WebInspector.DebuggerModel.Location} location |
| 500 * @param {?WebInspector.RemoteObject} handler |
| 501 * @param {string} sourceName |
| 502 */ |
| 503 WebInspector.EventListener = function(target, type, useCapture, location, handle
r, sourceName) |
| 504 { |
| 505 WebInspector.SDKObject.call(this, target); |
| 506 this._type = type; |
| 507 this._useCapture = useCapture; |
| 508 this._location = location; |
| 509 this._handler = handler; |
| 510 this._sourceName = sourceName; |
| 511 } |
| 512 |
| 513 /** |
| 496 * @param {!WebInspector.DebuggerModel} debuggerModel | 514 * @param {!WebInspector.DebuggerModel} debuggerModel |
| 497 * @param {!DOMDebuggerAgent.EventListener} payload | 515 * @param {!DOMDebuggerAgent.EventListener} payload |
| 498 * @param {!RuntimeAgent.RemoteObjectId} objectId | 516 * @return {!WebInspector.EventListener} |
| 499 */ | 517 */ |
| 500 WebInspector.EventListener = function(debuggerModel, payload, objectId) | 518 WebInspector.EventListener.fromPayload = function(debuggerModel, payload) |
| 501 { | 519 { |
| 502 WebInspector.SDKObject.call(this, debuggerModel.target()); | 520 var target = debuggerModel.target(); |
| 503 this._type = payload.type; | 521 var location = WebInspector.DebuggerModel.Location.fromPayload(debuggerModel
, payload.location); |
| 504 this._useCapture = payload.useCapture; | 522 var handler = payload.handler ? target.runtimeModel.createRemoteObject(paylo
ad.handler) : null; |
| 505 this._location = WebInspector.DebuggerModel.Location.fromPayload(debuggerMod
el, payload.location); | |
| 506 this._handler = payload.handler ? this.target().runtimeModel.createRemoteObj
ect(payload.handler) : null; | |
| 507 var script = debuggerModel.scriptForId(payload.location.scriptId); | 523 var script = debuggerModel.scriptForId(payload.location.scriptId); |
| 508 this._sourceName = script ? script.contentURL() : ""; | 524 var sourceName = script ? script.contentURL() : ""; |
| 509 this._objectId = objectId; | 525 return new WebInspector.EventListener(target, payload.type, payload.useCaptu
re, location, handler, sourceName); |
| 510 } | 526 } |
| 511 | 527 |
| 512 WebInspector.EventListener.prototype = { | 528 WebInspector.EventListener.prototype = { |
| 513 /** | 529 /** |
| 514 * @return {string} | 530 * @return {string} |
| 515 */ | 531 */ |
| 516 type: function() | 532 type: function() |
| 517 { | 533 { |
| 518 return this._type; | 534 return this._type; |
| 519 }, | 535 }, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 543 }, | 559 }, |
| 544 | 560 |
| 545 /** | 561 /** |
| 546 * @return {string} | 562 * @return {string} |
| 547 */ | 563 */ |
| 548 sourceName: function() | 564 sourceName: function() |
| 549 { | 565 { |
| 550 return this._sourceName; | 566 return this._sourceName; |
| 551 }, | 567 }, |
| 552 | 568 |
| 553 /** | |
| 554 * @return {!RuntimeAgent.RemoteObjectId} | |
| 555 */ | |
| 556 objectId: function() | |
| 557 { | |
| 558 return this._objectId; | |
| 559 }, | |
| 560 | |
| 561 __proto__: WebInspector.SDKObject.prototype | 569 __proto__: WebInspector.SDKObject.prototype |
| 562 } | 570 } |
| OLD | NEW |