Changeset 54047 in webkit
- Timestamp:
- Jan 28, 2010 11:16:56 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r54045 r54047 1 2010-01-28 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 MessageEvent.data should not be repeated deserialised 6 https://bugs.webkit.org/show_bug.cgi?id=34311 7 8 Add test to ensure we get the same value back when accessing event.data multiple times 9 10 * fast/dom/Window/window-postmessage-clone.html: 11 1 12 2010-01-28 Hayato Ito <hayato@chromium.org> 2 13 -
trunk/LayoutTests/fast/dom/Window/window-postmessage-clone.html
r53774 r54047 74 74 75 75 function onmessage(evt) { 76 eventData = evt.data 76 eventData = evt.data; 77 if (evt.data !== evt.data) 78 console.innerHTML += "MessageEvent.data does not produce the same value on multiple queries."; 77 79 shouldBe("eventData", messages.shift()); 78 80 -
trunk/WebCore/ChangeLog
r54045 r54047 1 2010-01-28 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 MessageEvent.data should not be repeated deserialised 6 https://bugs.webkit.org/show_bug.cgi?id=34311 7 8 Cache the result of deserialising the event data 9 10 * bindings/scripts/CodeGeneratorJS.pm: 11 * dom/MessageEvent.idl: 12 1 13 2010-01-28 Hayato Ito <hayato@chromium.org> 2 14 -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r54042 r54047 38 38 my %implIncludes = (); 39 39 my @depsContent = (); 40 my $numCachedAttributes = 0; 41 my $currentCachedAttribute = 0; 40 42 41 43 # Default .h template … … 669 671 $numCustomAttributes++ if $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCCustomGetter"}; 670 672 $numCustomAttributes++ if $attribute->signature->extendedAttributes->{"CustomSetter"} || $attribute->signature->extendedAttributes->{"JSCCustomSetter"}; 671 } 672 } 673 673 if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) { 674 push(@headerContent, " static const unsigned " . $attribute->signature->name . "Slot = $numCachedAttributes + Base::AnonymousSlotCount;\n"); 675 $numCachedAttributes++; 676 } 677 } 678 } 679 680 if ($numCachedAttributes > 0) { 681 push(@headerContent, " using $parentClassName" . "::putAnonymousValue;\n"); 682 push(@headerContent, " using $parentClassName" . "::getAnonymousValue;\n"); 683 } 674 684 if ($numCustomAttributes > 0) { 675 685 push(@headerContent, "\n // Custom attributes\n"); … … 718 728 } 719 729 730 # anonymous slots 731 if ($numCachedAttributes) { 732 push(@headerContent, "public:\n"); 733 push(@headerContent, " static const unsigned AnonymousSlotCount = $numCachedAttributes + Base::AnonymousSlotCount;\n"); 734 } 735 720 736 # structure flags 721 737 push(@headerContent, "protected:\n"); … … 1170 1186 } 1171 1187 push(@implContent, "{\n"); 1188 if ($numCachedAttributes > 0) { 1189 push(@implContent, " for (unsigned i = Base::AnonymousSlotCount; i < AnonymousSlotCount; i++)\n"); 1190 push(@implContent, " putAnonymousValue(i, JSValue());\n"); 1191 } 1172 1192 push(@implContent, "}\n\n"); 1173 1193 … … 1315 1335 } elsif (!@{$attribute->getterExceptions}) { 1316 1336 push(@implContent, " UNUSED_PARAM(exec);\n"); 1337 my $cacheIndex = 0; 1338 if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) { 1339 $cacheIndex = $currentCachedAttribute; 1340 $currentCachedAttribute++; 1341 push(@implContent, " if (JSValue cachedValue = castedThis->getAnonymousValue(" . $className . "::" . $attribute->signature->name . "Slot))\n"); 1342 push(@implContent, " return cachedValue;\n"); 1343 } 1317 1344 if ($podType) { 1318 1345 push(@implContent, " $podType imp(*castedThis->impl());\n"); 1319 1346 if ($podType eq "float") { # Special case for JSSVGNumber 1320 push(@implContent, " return" . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp", "castedThis") . ";\n");1347 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp", "castedThis") . ";\n"); 1321 1348 } else { 1322 push(@implContent, " return" . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp.$implGetterFunctionName()", "castedThis") . ";\n");1349 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp.$implGetterFunctionName()", "castedThis") . ";\n"); 1323 1350 } 1324 1351 } else { … … 1339 1366 if ($codeGenerator->IsSVGAnimatedType($type)) { 1340 1367 push(@implContent, " RefPtr<$type> obj = $jsType;\n"); 1341 push(@implContent, " returntoJS(exec, castedThis->globalObject(), obj.get(), imp);\n");1368 push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);\n"); 1342 1369 } else { 1343 push(@implContent, " return$jsType;\n");1370 push(@implContent, " JSValue result = $jsType;\n"); 1344 1371 } 1345 1372 } 1373 1374 push(@implContent, " castedThis->putAnonymousValue(" . $className . "::" . $attribute->signature->name . "Slot, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"}); 1375 push(@implContent, " return result;\n"); 1376 1346 1377 } else { 1347 1378 push(@implContent, " ExceptionCode ec = 0;\n"); -
trunk/WebCore/dom/MessageEvent.idl
r52537 r54047 30 30 NoStaticTables 31 31 ] MessageEvent : Event { 32 readonly attribute SerializedScriptValue data;32 readonly attribute [CachedAttribute] SerializedScriptValue data; 33 33 34 34 readonly attribute DOMString origin;
Note: See TracChangeset
for help on using the changeset viewer.