Changeset 90558 in webkit
- Timestamp:
- Jul 7, 2011 6:44:55 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90556 r90558 1 2011-07-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Web Inspector: Protocol: pointers to optional "in" parameters passing to the 4 backend methods should be NULL if they are not specified in the message. 5 https://bugs.webkit.org/show_bug.cgi?id=64083 6 7 Reviewed by Pavel Feldman. 8 9 * inspector/CodeGeneratorInspector.pm: 10 (generateBackendFunction): 11 (generateArgumentGetters): 12 * inspector/InspectorCSSAgent.cpp: 13 (WebCore::InspectorCSSAgent::getStylesForNode): 14 1 15 2011-07-07 Ilya Tikhonovsky <loislo@chromium.org> 2 16 -
trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm
r90394 r90558 465 465 my $type = $parameter->type; 466 466 my $typeString = camelCase($parameter->type); 467 my $optional = $parameter->extendedAttributes->{"optional"} ? "true" : "false"; 468 push(@function, " " . typeTraits($type, "variable") . " in_$name = get$typeString(paramsContainerPtr, \"$name\", $optional, protocolErrorsPtr);"); 467 my $optionalFlagArgument = "0"; 468 if ($parameter->extendedAttributes->{"optional"}) { 469 push(@function, " bool ${name}_valueFound = false;"); 470 $optionalFlagArgument = "&${name}_valueFound"; 471 } 472 push(@function, " " . typeTraits($type, "variable") . " in_$name = get$typeString(paramsContainerPtr, \"$name\", $optionalFlagArgument, protocolErrorsPtr);"); 469 473 } 470 474 push(@function, ""); … … 472 476 } 473 477 474 475 478 my $args = join(", ", 476 479 ("&error", 477 map(($_->extendedAttributes->{"optional"} ? "&" : "") . "in_" . $_->name, @inArgs), 480 map(($_->extendedAttributes->{"optional"} ? 481 $_->name . "_valueFound ? &in_" . $_->name . " : 0" : 482 "in_" . $_->name), @inArgs), 478 483 map("&out_" . $_->name, @outArgs))); 479 484 … … 581 586 582 587 my $typeString = camelCase($type); 583 push(@backendConstantDeclarations, " static $return get$typeString(InspectorObject* object, const String& name, bool optional, InspectorArray* protocolErrors);");588 push(@backendConstantDeclarations, " static $return get$typeString(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);"); 584 589 my $getterBody = << "EOF"; 585 590 586 $return InspectorBackendDispatcher::get$typeString(InspectorObject* object, const String& name, bool optional, InspectorArray* protocolErrors)591 $return InspectorBackendDispatcher::get$typeString(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors) 587 592 { 588 593 ASSERT(object); 589 594 ASSERT(protocolErrors); 595 596 if (valueFound) 597 *valueFound = false; 590 598 591 599 $variable value = $defaultValue; … … 594 602 595 603 if (valueIterator == end) { 596 if (! optional)604 if (!valueFound) 597 605 protocolErrors->pushString(String::format("Parameter '\%s' with type '$json' was not found.", name.utf8().data())); 598 606 return value; … … 601 609 if (!valueIterator->second->as$json(&value)) 602 610 protocolErrors->pushString(String::format("Parameter '\%s' has wrong type. It should be '$json'.", name.utf8().data())); 611 else 612 if (valueFound) 613 *valueFound = true; 603 614 return value; 604 615 } -
trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp
r89922 r90558 228 228 resultObject->setObject("computedStyle", computedInspectorStyle->buildObjectForStyle()); 229 229 230 unsigned forcePseudoClassMask = computePseudoClassMask(forcedPseudoClasses ->get());230 unsigned forcePseudoClassMask = computePseudoClassMask(forcedPseudoClasses ? forcedPseudoClasses->get() : 0); 231 231 CSSStyleSelector* selector = element->ownerDocument()->styleSelector(); 232 232 RefPtr<CSSRuleList> matchedRules = selector->styleRulesForElement(element, CSSStyleSelector::AllCSSRules, forcePseudoClassMask);
Note: See TracChangeset
for help on using the changeset viewer.