Changeset 96227 in webkit
- Timestamp:
- Sep 28, 2011 9:57:17 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96224 r96227 1 2011-09-28 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Web Inspector: optional arguments support for the frontend needs to be extended. 4 https://bugs.webkit.org/show_bug.cgi?id=69005 5 6 Generator supports optional arguments but they are transferred by value. 7 It is not suitable if the used type doesn't have operator bool. 8 I'll transfer such arguments by pointer. 9 10 Reviewed by Pavel Feldman. 11 12 Build is the test. 13 14 * inspector/CodeGeneratorInspector.pm: 15 (generateFrontendFunction): 16 (paramTypeTraits): 17 * inspector/InspectorDebuggerAgent.cpp: 18 (WebCore::InspectorDebuggerAgent::didParseSource): 19 * inspector/InspectorResourceAgent.cpp: 20 (WebCore::InspectorResourceAgent::didFailLoading): 21 1 22 2011-09-28 Antaryami Pandia <antaryami.pandia@motorola.com> 2 23 -
trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm
r96222 r96227 135 135 $typeTransform{"String"} = { 136 136 "param" => "const String&", 137 "optional_param" => "const String* const", 138 "optional_valueAccessor" => "*", 137 139 "variable" => "String", 138 140 "return" => "String", … … 145 147 $typeTransform{"long"} = { 146 148 "param" => "long", 149 "optional_param" => "const long* const", 150 "optional_valueAccessor" => "*", 147 151 "variable" => "long", 148 152 "defaultValue" => "0", … … 154 158 $typeTransform{"int"} = { 155 159 "param" => "int", 160 "optional_param" => "const int* const", 161 "optional_valueAccessor" => "*", 156 162 "variable" => "int", 157 163 "defaultValue" => "0", … … 163 169 $typeTransform{"unsigned long"} = { 164 170 "param" => "unsigned long", 171 "optional_param" => "const unsigned long* const", 172 "optional_valueAccessor" => "*", 165 173 "variable" => "unsigned long", 166 174 "defaultValue" => "0u", … … 172 180 $typeTransform{"unsigned int"} = { 173 181 "param" => "unsigned int", 182 "optional_param" => "const unsigned int* const", 183 "optional_valueAccessor" => "*", 174 184 "variable" => "unsigned int", 175 185 "defaultValue" => "0u", … … 181 191 $typeTransform{"double"} = { 182 192 "param" => "double", 193 "optional_param" => "const double* const", 194 "optional_valueAccessor" => "*", 183 195 "variable" => "double", 184 196 "defaultValue" => "0.0", … … 190 202 $typeTransform{"boolean"} = { 191 203 "param" => "bool", 204 "optional_param" => "const bool* const", 205 "optional_valueAccessor" => "*", 192 206 "variable"=> "bool", 193 207 "defaultValue" => "false", … … 377 391 my @argsFiltered = grep($_->direction eq "out", @{$function->parameters}); # just keep only out parameters for frontend interface. 378 392 map($frontendTypes{$_->type} = 1, @argsFiltered); # register required types. 379 my $arguments = join(", ", map( typeTraits($_->type, "param") . " " . $_->name, @argsFiltered)); # prepare arguments for function signature.393 my $arguments = join(", ", map(paramTypeTraits($_, "param") . " " . $_->name, @argsFiltered)); # prepare arguments for function signature. 380 394 381 395 my $signature = " void ${functionName}(${arguments});"; … … 394 408 foreach my $parameter (@argsFiltered) { 395 409 my $optional = $parameter->extendedAttributes->{"optional"} ? "if (" . $parameter->name . ")\n " : ""; 396 push(@function, " " . $optional . "paramsObject->set" . typeTraits($parameter->type, "JSONType") . "(\"" . $parameter->name . "\", ". $parameter->name . ");");410 push(@function, " " . $optional . "paramsObject->set" . paramTypeTraits($parameter, "JSONType") . "(\"" . $parameter->name . "\", " . paramTypeTraits($parameter, "valueAccessor") . $parameter->name . ");"); 397 411 } 398 412 push(@function, " ${functionName}Message->setObject(\"params\", paramsObject);"); … … 1095 1109 my $trait = shift; 1096 1110 return $typeTransform{$type}->{$trait}; 1111 } 1112 1113 sub paramTypeTraits 1114 { 1115 my $paramDescription = shift; 1116 my $trait = shift; 1117 if ($paramDescription->extendedAttributes->{"optional"}) { 1118 my $optionalResult = typeTraits($paramDescription->type, "optional_" . $trait); 1119 return $optionalResult if defined $optionalResult; 1120 } 1121 my $result = typeTraits($paramDescription->type, $trait); 1122 return defined $result ? $result : ""; 1097 1123 } 1098 1124 -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
r95901 r96227 438 438 { 439 439 // Don't send script content to the front end until it's really needed. 440 m_frontend->scriptParsed(scriptId, script.url, script.startLine, script.startColumn, script.endLine, script.endColumn, script.isContentScript );440 m_frontend->scriptParsed(scriptId, script.url, script.startLine, script.startColumn, script.endLine, script.endColumn, script.isContentScript ? &script.isContentScript : 0); 441 441 442 442 m_scripts.set(scriptId, script); -
trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp
r95901 r96227 300 300 } 301 301 302 m_frontend->loadingFailed(requestId, currentTime(), error.localizedDescription(), error.isCancellation()); 302 bool canceled = error.isCancellation(); 303 m_frontend->loadingFailed(requestId, currentTime(), error.localizedDescription(), canceled ? &canceled : 0); 303 304 } 304 305
Note: See TracChangeset
for help on using the changeset viewer.