Changeset 83739 in webkit
- Timestamp:
- Apr 13, 2011 8:44:38 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83736 r83739 1 2011-04-13 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: there is a problem if an optional param is not at the end of a params list. 6 https://bugs.webkit.org/show_bug.cgi?id=58440 7 8 In InspectorBackend.dispatch method we are converting the message's params object into array of arguments 9 for a callback. But in some cases the optional parameter is declared in the middle of the params list. 10 That gets us into a problem if this param has been skipped in the message. In that case the tail of the 11 event params will be shifted. We can slightly modify dispatcher and it will put the params in right places. 12 13 * inspector/CodeGeneratorInspector.pm: 14 1 15 2011-04-13 Ben Taylor <bentaylor.solx86@gmail.com> 2 16 -
trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm
r83580 r83739 224 224 my @backendFooter; 225 225 my @backendJSStubs; 226 my @backendJSEvents; 226 227 my %backendDomains; 227 228 … … 349 350 350 351 collectBackendJSStubFunctions($interface); 352 collectBackendJSStubEvents($interface); 351 353 } 352 354 … … 682 684 } 683 685 686 sub collectBackendJSStubEvents 687 { 688 my $interface = shift; 689 my @functions = grep($_->signature->extendedAttributes->{"event"}, @{$interface->functions}); 690 my $domain = $interface->name; 691 692 foreach my $function (@functions) { 693 my $name = $domain . "." . $function->signature->name; 694 my @outArgs = grep($_->direction eq "out", @{$function->parameters}); 695 my $argumentNames = join(",", map("\"" . $_->name . "\"" , @outArgs)); 696 push(@backendJSEvents, " this._eventArgs[\"" . $name . "\"] = [" . $argumentNames ."];"); 697 } 698 } 699 684 700 sub generateBackendStubJS 685 701 { 686 702 my $JSStubs = join("\n", @backendJSStubs); 703 my $JSEvents = join("\n", @backendJSEvents); 687 704 my $inspectorBackendStubJS = << "EOF"; 688 705 $licenseTemplate … … 694 711 this._callbacks = {}; 695 712 this._domainDispatchers = {}; 713 this._eventArgs = {}; 696 714 $JSStubs 715 $JSEvents 697 716 } 698 717 … … 812 831 } 813 832 833 if (!this._eventArgs[messageObject.method]) { 834 console.error("Protocol Error: Attempted to dispatch an unspecified method '" + messageObject.method + "'"); 835 return; 836 } 837 814 838 var params = []; 815 839 if (messageObject.params) { 816 for (var key in messageObject.params) 817 params.push(messageObject.params[key]); 840 var paramNames = this._eventArgs[messageObject.method]; 841 for (var i = 0; i < paramNames.length; ++i) 842 params.push(messageObject.params[paramNames[i]]); 818 843 } 819 844
Note: See TracChangeset
for help on using the changeset viewer.