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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js

Issue 2159633002: [DevTools] Generate public versions of protocol classes to be exposed in v8_inspector/public. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: works Created 4 years, 5 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
OLDNEW
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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 /** 496 /**
497 * @override 497 * @override
498 * @return {!Promise<?Array<!WebInspector.EventListener>>} 498 * @return {!Promise<?Array<!WebInspector.EventListener>>}
499 */ 499 */
500 eventListeners: function() 500 eventListeners: function()
501 { 501 {
502 return new Promise(eventListeners.bind(this)); 502 return new Promise(eventListeners.bind(this));
503 /** 503 /**
504 * @param {function(?)} fulfill 504 * @param {function(?)} fulfill
505 * @param {function(*)} reject 505 * @param {function(*)} reject
506 * @this {WebInspector.RemoteObject} 506 * @this {WebInspector.RemoteObjectImpl}
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(null);
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.RemoteObject} 524 * @this {!WebInspector.RemoteObjectImpl}
pfeldman 2016/07/22 18:02:40 While you are here, remove !
dgozman 2016/07/22 21:21:19 Done.
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(null);
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.RemoteObject} 538 * @this {!WebInspector.RemoteObjectImpl}
pfeldman 2016/07/22 18:02:40 ditto
539 * @param {!DOMDebuggerAgent.EventListener} payload 539 * @param {!DOMDebuggerAgent.EventListener} payload
540 */ 540 */
541 function createEventListener(payload) 541 function createEventListener(payload)
542 { 542 {
543 return new WebInspector.EventListener(this._target, 543 return new WebInspector.EventListener(this._target,
544 this, 544 this,
545 payload.type, 545 payload.type,
546 payload.useCapture, 546 payload.useCapture,
547 payload.passive, 547 payload.passive,
548 payload.handler ? this.tar get().runtimeModel.createRemoteObject(payload.handler) : null, 548 payload.handler ? this.tar get().runtimeModel.createRemoteObject(payload.handler) : null,
549 payload.originalHandler ? this.target().runtimeModel.createRemoteObject(payload.originalHandler) : null, 549 payload.originalHandler ? this.target().runtimeModel.createRemoteObject(payload.originalHandler) : null,
550 WebInspector.DebuggerModel .Location.fromPayload(this._debuggerModel, payload.location), 550 /** @type {!WebInspector.D ebuggerModel.Location} */ (this._debuggerModel.createRawLocationByScriptId(paylo ad.scriptId, payload.lineNumber, payload.columnNumber)),
551 payload.removeFunction ? t his.target().runtimeModel.createRemoteObject(payload.removeFunction) : null); 551 payload.removeFunction ? t his.target().runtimeModel.createRemoteObject(payload.removeFunction) : null);
552 } 552 }
553 } 553 }
554 }, 554 },
555 555
556 /** 556 /**
557 * @param {!Array.<string>} propertyPath 557 * @param {!Array.<string>} propertyPath
558 * @param {function(?WebInspector.RemoteObject, boolean=)} callback 558 * @param {function(?WebInspector.RemoteObject, boolean=)} callback
559 */ 559 */
560 getProperty: function(propertyPath, callback) 560 getProperty: function(propertyPath, callback)
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 }, 1509 },
1510 1510
1511 /** 1511 /**
1512 * @return {!WebInspector.RemoteObject} 1512 * @return {!WebInspector.RemoteObject}
1513 */ 1513 */
1514 object: function() 1514 object: function()
1515 { 1515 {
1516 return this._object; 1516 return this._object;
1517 } 1517 }
1518 } 1518 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698