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

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

Issue 1845493004: Modify devtools to show passive event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Layout Tests Created 4 years, 8 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) 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 563
564 __proto__: WebInspector.SDKObject.prototype 564 __proto__: WebInspector.SDKObject.prototype
565 } 565 }
566 566
567 /** 567 /**
568 * @constructor 568 * @constructor
569 * @extends {WebInspector.SDKObject} 569 * @extends {WebInspector.SDKObject}
570 * @param {!WebInspector.Target} target 570 * @param {!WebInspector.Target} target
571 * @param {string} type 571 * @param {string} type
572 * @param {boolean} useCapture 572 * @param {boolean} useCapture
573 * @param {boolean} passive
573 * @param {?WebInspector.RemoteObject} handler 574 * @param {?WebInspector.RemoteObject} handler
574 * @param {?WebInspector.RemoteObject} originalHandler 575 * @param {?WebInspector.RemoteObject} originalHandler
575 * @param {!WebInspector.DebuggerModel.Location} location 576 * @param {!WebInspector.DebuggerModel.Location} location
576 * @param {?WebInspector.RemoteObject} removeFunction 577 * @param {?WebInspector.RemoteObject} removeFunction
577 * @param {string=} listenerType 578 * @param {string=} listenerType
578 */ 579 */
579 WebInspector.EventListener = function(target, type, useCapture, handler, origina lHandler, location, removeFunction, listenerType) 580 WebInspector.EventListener = function(target, type, useCapture, passive, handler , originalHandler, location, removeFunction, listenerType)
580 { 581 {
581 WebInspector.SDKObject.call(this, target); 582 WebInspector.SDKObject.call(this, target);
582 this._type = type; 583 this._type = type;
583 this._useCapture = useCapture; 584 this._useCapture = useCapture;
585 this._passive = passive;
584 this._handler = handler; 586 this._handler = handler;
585 this._originalHandler = originalHandler || handler; 587 this._originalHandler = originalHandler || handler;
586 this._location = location; 588 this._location = location;
587 var script = location.script(); 589 var script = location.script();
588 this._sourceURL = script ? script.contentURL() : ""; 590 this._sourceURL = script ? script.contentURL() : "";
589 this._removeFunction = removeFunction; 591 this._removeFunction = removeFunction;
590 this._listenerType = listenerType || "normal"; 592 this._listenerType = listenerType || "normal";
591 } 593 }
592 594
593 WebInspector.EventListener.prototype = { 595 WebInspector.EventListener.prototype = {
594 /** 596 /**
595 * @return {string} 597 * @return {string}
596 */ 598 */
597 type: function() 599 type: function()
598 { 600 {
599 return this._type; 601 return this._type;
600 }, 602 },
601 603
602 /** 604 /**
603 * @return {boolean} 605 * @return {boolean}
604 */ 606 */
605 useCapture: function() 607 useCapture: function()
606 { 608 {
607 return this._useCapture; 609 return this._useCapture;
608 }, 610 },
609 611
610 /** 612 /**
613 * @return {boolean}
614 */
615 passive: function()
616 {
617 return this._passive;
618 },
619
620 /**
611 * @return {?WebInspector.RemoteObject} 621 * @return {?WebInspector.RemoteObject}
612 */ 622 */
613 handler: function() 623 handler: function()
614 { 624 {
615 return this._handler; 625 return this._handler;
616 }, 626 },
617 627
618 /** 628 /**
619 * @return {!WebInspector.DebuggerModel.Location} 629 * @return {!WebInspector.DebuggerModel.Location}
620 */ 630 */
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 /** 669 /**
660 * @param {function()} success 670 * @param {function()} success
661 * @this {WebInspector.EventListener} 671 * @this {WebInspector.EventListener}
662 */ 672 */
663 function promiseConstructor(success) 673 function promiseConstructor(success)
664 { 674 {
665 this._removeFunction.callFunction(callCustomRemove, [ 675 this._removeFunction.callFunction(callCustomRemove, [
666 WebInspector.RemoteObject.toCallArgument(this._removeFunction), 676 WebInspector.RemoteObject.toCallArgument(this._removeFunction),
667 WebInspector.RemoteObject.toCallArgument(this._type), 677 WebInspector.RemoteObject.toCallArgument(this._type),
668 WebInspector.RemoteObject.toCallArgument(this._originalHandler), 678 WebInspector.RemoteObject.toCallArgument(this._originalHandler),
669 WebInspector.RemoteObject.toCallArgument(this._useCapture) 679 WebInspector.RemoteObject.toCallArgument(this._useCapture),
680 WebInspector.RemoteObject.toCallArgument(this._passive),
670 ], success); 681 ], success);
671 682
672 /** 683 /**
673 * @param {function(string, function(), boolean)} func 684 * @param {function(string, function(), boolean, boolean)} func
674 * @param {string} type 685 * @param {string} type
675 * @param {function()} listener 686 * @param {function()} listener
676 * @param {boolean} useCapture 687 * @param {boolean} useCapture
688 * @param {boolean} passive
677 */ 689 */
678 function callCustomRemove(func, type, listener, useCapture) 690 function callCustomRemove(func, type, listener, useCapture, passive)
679 { 691 {
680 func.call(null, type, listener, useCapture); 692 func.call(null, type, listener, useCapture, passive);
681 } 693 }
682 } 694 }
683 }, 695 },
684 696
685 /** 697 /**
686 * @return {string} 698 * @return {string}
687 */ 699 */
688 listenerType: function() 700 listenerType: function()
689 { 701 {
690 return this._listenerType; 702 return this._listenerType;
691 }, 703 },
692 704
693 /** 705 /**
694 * @param {string} listenerType 706 * @param {string} listenerType
695 */ 707 */
696 setListenerType: function(listenerType) 708 setListenerType: function(listenerType)
697 { 709 {
698 this._listenerType = listenerType; 710 this._listenerType = listenerType;
699 }, 711 },
700 712
701 __proto__: WebInspector.SDKObject.prototype 713 __proto__: WebInspector.SDKObject.prototype
702 } 714 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698