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

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

Issue 1268353005: [DevTools] Support JQuery event listeners (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Implemented in frontend code Created 5 years, 4 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 /** 127 /**
128 * @return {!Promise<?Array<!WebInspector.EventListener>>} 128 * @return {!Promise<?Array<!WebInspector.EventListener>>}
129 */ 129 */
130 eventListeners: function() 130 eventListeners: function()
131 { 131 {
132 throw "Not implemented"; 132 throw "Not implemented";
133 }, 133 },
134 134
135 /** 135 /**
136 * @param {function(this:Node)} listenersGetter
137 * @return {!Promise<?Array<!WebInspector.EventListener>>}
138 */
139 frameworkEventListeners: function(listenersGetter)
140 {
141 throw "Not implemented";
142 },
143
144 /**
145 * @param {function(this:Node)} handlersGetter
146 * @return {!Promise<?Array<function()>>}
147 */
148 frameworkInternalEventHandlers: function(handlersGetter)
149 {
150 throw "Not implemented";
151 },
152
153 /**
136 * @param {!RuntimeAgent.CallArgument} name 154 * @param {!RuntimeAgent.CallArgument} name
137 * @param {function(string=)} callback 155 * @param {function(string=)} callback
138 */ 156 */
139 deleteProperty: function(name, callback) 157 deleteProperty: function(name, callback)
140 { 158 {
141 throw "Not implemented"; 159 throw "Not implemented";
142 }, 160 },
143 161
144 /** 162 /**
145 * @param {function(this:Object, ...)} functionDeclaration 163 * @param {function(this:Object, ...)} functionDeclaration
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 * @param {function(this:Object)} functionDeclaration 205 * @param {function(this:Object)} functionDeclaration
188 * @param {!Array.<!RuntimeAgent.CallArgument>|undefined} args 206 * @param {!Array.<!RuntimeAgent.CallArgument>|undefined} args
189 * @param {function(*)} callback 207 * @param {function(*)} callback
190 */ 208 */
191 callFunctionJSON: function(functionDeclaration, args, callback) 209 callFunctionJSON: function(functionDeclaration, args, callback)
192 { 210 {
193 throw "Not implemented"; 211 throw "Not implemented";
194 }, 212 },
195 213
196 /** 214 /**
215 * @param {function(this:Object, ...)} functionDeclaration
216 * @param {!Array.<!RuntimeAgent.CallArgument>|undefined} args
217 * @return {!Promise<*>}
218 */
219 callFunctionJSONPromise: function(functionDeclaration, args)
220 {
221 return new Promise(promiseConstructor.bind(this));
222
223 /**
224 * @param {function(*)} success
225 * @this {WebInspector.RemoteObject}
226 */
227 function promiseConstructor(success)
228 {
229 this.callFunctionJSON(functionDeclaration, args, success);
230 }
231 },
232
233 /**
197 * @return {!WebInspector.Target} 234 * @return {!WebInspector.Target}
198 */ 235 */
199 target: function() 236 target: function()
200 { 237 {
201 throw new Error("Target-less object"); 238 throw new Error("Target-less object");
202 }, 239 },
203 240
204 /** 241 /**
205 * @return {?WebInspector.DebuggerModel} 242 * @return {?WebInspector.DebuggerModel}
206 */ 243 */
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 return; 519 return;
483 } 520 }
484 fulfill(payloads.map(createEventListener.bind(this))); 521 fulfill(payloads.map(createEventListener.bind(this)));
485 } 522 }
486 /** 523 /**
487 * @this {!WebInspector.RemoteObject} 524 * @this {!WebInspector.RemoteObject}
488 * @param {!DOMDebuggerAgent.EventListener} payload 525 * @param {!DOMDebuggerAgent.EventListener} payload
489 */ 526 */
490 function createEventListener(payload) 527 function createEventListener(payload)
491 { 528 {
492 return new WebInspector.EventListener(this._debuggerModel, paylo ad, this._objectId); 529 return WebInspector.EventListener.fromPayload(this._debuggerMode l, payload);
493 } 530 }
494 } 531 }
495 }, 532 },
496 533
497 /** 534 /**
535 * @override
536 * @param {function(this:Object)} listenersGetter
537 * @return {!Promise<?Array<!WebInspector.EventListener>>}
538 */
539 frameworkEventListeners: function(listenersGetter)
540 {
541 return this.callFunctionPromise(listenersGetter, undefined).then(WebInsp ector.castEventListeners);
542 },
543
544 /**
545 * @override
546 * @param {function(this:Object)} handlersGetter
547 * @return {!Promise<?Array<function()>>}
548 */
549 frameworkInternalEventHandlers: function(handlersGetter)
550 {
551 return this.callFunctionPromise(handlersGetter, undefined).then(WebInspe ctor.castEventHandlers);
552 },
553
554 /**
498 * @param {!Array.<string>} propertyPath 555 * @param {!Array.<string>} propertyPath
499 * @param {function(?WebInspector.RemoteObject, boolean=)} callback 556 * @param {function(?WebInspector.RemoteObject, boolean=)} callback
500 */ 557 */
501 getProperty: function(propertyPath, callback) 558 getProperty: function(propertyPath, callback)
502 { 559 {
503 /** 560 /**
504 * @param {string} arrayStr 561 * @param {string} arrayStr
505 * @suppressReceiverCheck 562 * @suppressReceiverCheck
506 * @this {Object} 563 * @this {Object}
507 */ 564 */
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 { 1342 {
1286 if (!this._cachedDescription) { 1343 if (!this._cachedDescription) {
1287 var children = this._children(); 1344 var children = this._children();
1288 this._cachedDescription = "{" + this._formatValue(children[0].value) + " => " + this._formatValue(children[1].value) + "}"; 1345 this._cachedDescription = "{" + this._formatValue(children[0].value) + " => " + this._formatValue(children[1].value) + "}";
1289 } 1346 }
1290 return this._cachedDescription; 1347 return this._cachedDescription;
1291 }, 1348 },
1292 1349
1293 __proto__: WebInspector.LocalJSONObject.prototype 1350 __proto__: WebInspector.LocalJSONObject.prototype
1294 } 1351 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698