Changeset 167140 in webkit
- Timestamp:
- Apr 11, 2014 1:05:39 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167138 r167140 1 2014-04-11 Brian J. Burg <burg@cs.washington.edu> 2 3 Web Replay: CodeGeneratorJS should guard includes of replay-related headers 4 https://bugs.webkit.org/show_bug.cgi?id=131407 5 6 Reviewed by Timothy Hatcher. 7 8 This patch adds guards to headers that are only required by generated replay code 9 that is itself guarded. Other ports probably haven't added the headers to their 10 build files, so we don't want to emit the unused header includes. 11 12 This patch also converts generated uses of DEFINE_STATIC_LOCAL to NeverDestroyed<T>. 13 Finally, a new bindings test was added to document changes to generated replay code. 14 15 Test: Source/WebCore/bindings/scripts/test/TestNondeterministic.idl 16 17 * bindings/scripts/CodeGeneratorJS.pm: 18 (GenerateImplementation): 19 (GenerateImplementationFunctionCall): 20 21 * bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.cpp: Added. 22 * bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.h: Added. 23 * bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.symbols: Added. 24 * bindings/scripts/test/GObject/WebKitDOMTestNondeterministicPrivate.h: Added. 25 * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Added. 26 * bindings/scripts/test/JS/JSTestNondeterministic.h: Added. 27 * bindings/scripts/test/ObjC/DOMTestNondeterministic.h: Added. 28 * bindings/scripts/test/ObjC/DOMTestNondeterministic.mm: Added. 29 * bindings/scripts/test/ObjC/DOMTestNondeterministicInternal.h: Added. 30 * bindings/scripts/test/TestNondeterministic.idl: Added. 31 1 32 2014-04-11 Antti Koivisto <antti@apple.com> 2 33 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r167020 r167140 2197 2197 2198 2198 if ($attribute->signature->extendedAttributes->{"Nondeterministic"}) { 2199 $implIncludes{"<replay/InputCursor.h>"} = 1; 2199 AddToImplIncludes("MemoizedDOMResult.h", "WEB_REPLAY"); 2200 AddToImplIncludes("<replay/InputCursor.h>", "WEB_REPLAY"); 2201 AddToImplIncludes("<wtf/NeverDestroyed.h>", "WEB_REPLAY"); 2202 2200 2203 push(@implContent, "#if ENABLE(WEB_REPLAY)\n"); 2201 2204 push(@implContent, " JSGlobalObject* globalObject = exec->lexicalGlobalObject();\n"); 2202 2205 push(@implContent, " InputCursor& cursor = globalObject->inputCursor();\n"); 2203 2206 2204 $implIncludes{"MemoizedDOMResult.h"} = 1;2205 2207 my $nativeType = GetNativeType($type); 2206 2208 my $memoizedType = GetNativeTypeForMemoization($type); 2207 2209 my $exceptionCode = $getterExceptions ? "ec" : "0"; 2208 push(@implContent, " DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, bindingName, (\"$interfaceName.$name\", AtomicString::ConstructFromLiteral));\n");2210 push(@implContent, " static NeverDestroyed<const AtomicString> bindingName(\"$interfaceName.$name\", AtomicString::ConstructFromLiteral);\n"); 2209 2211 push(@implContent, " if (cursor.isCapturing()) {\n"); 2210 2212 push(@implContent, " $memoizedType memoizedResult = castedThis->impl().$implGetterFunctionName(" . join(", ", @arguments) . ");\n"); 2211 push(@implContent, " cursor.appendInput<MemoizedDOMResult<$memoizedType>>(bindingName , memoizedResult, $exceptionCode);\n");2213 push(@implContent, " cursor.appendInput<MemoizedDOMResult<$memoizedType>>(bindingName.get().string(), memoizedResult, $exceptionCode);\n"); 2212 2214 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "memoizedResult", "castedThis") . ";\n"); 2213 2215 push(@implContent, " setDOMException(exec, ec);\n") if $getterExceptions; … … 3556 3558 if ($function->signature->type eq "void") { 3557 3559 if ($nondeterministic) { 3558 $implIncludes{"<replay/InputCursor.h>"} = 1;3560 AddToImplIncludes("<replay/InputCursor.h>", "WEB_REPLAY"); 3559 3561 push(@implContent, "#if ENABLE(WEB_REPLAY)\n"); 3560 3562 push(@implContent, $indent . "InputCursor& cursor = exec->lexicalGlobalObject()->inputCursor();\n"); … … 3585 3587 my $thisObject = $function->isStatic ? 0 : "castedThis"; 3586 3588 if ($nondeterministic) { 3587 $implIncludes{"MemoizedDOMResult.h"} = 1; 3588 $implIncludes{"<replay/InputCursor.h>"} = 1; 3589 AddToImplIncludes("MemoizedDOMResult.h", "WEB_REPLAY"); 3590 AddToImplIncludes("<replay/InputCursor.h>", "WEB_REPLAY"); 3591 AddToImplIncludes("<wtf/NeverDestroyed.h>", "WEB_REPLAY"); 3592 3589 3593 my $nativeType = GetNativeTypeFromSignature($function->signature); 3590 3594 my $memoizedType = GetNativeTypeForMemoization($function->signature->type); … … 3593 3597 push(@implContent, "#if ENABLE(WEB_REPLAY)\n"); 3594 3598 push(@implContent, $indent . "InputCursor& cursor = exec->lexicalGlobalObject()->inputCursor();\n"); 3595 push(@implContent, $indent . " DEFINE_STATIC_LOCAL(const AtomicString, bindingName, (\"$bindingName\", AtomicString::ConstructFromLiteral));\n");3599 push(@implContent, $indent . "static NeverDestroyed<const AtomicString> bindingName(\"$bindingName\", AtomicString::ConstructFromLiteral);\n"); 3596 3600 push(@implContent, $indent . "if (cursor.isCapturing()) {\n"); 3597 3601 push(@implContent, $indent . " $nativeType memoizedResult = $functionString;\n"); 3598 3602 my $exceptionCode = $raisesException ? "ec" : "0"; 3599 push(@implContent, $indent . " cursor.appendInput<MemoizedDOMResult<$memoizedType>>(bindingName , memoizedResult, $exceptionCode);\n");3603 push(@implContent, $indent . " cursor.appendInput<MemoizedDOMResult<$memoizedType>>(bindingName.get().string(), memoizedResult, $exceptionCode);\n"); 3600 3604 push(@implContent, $indent . " result = " . NativeToJSValue($function->signature, 1, $interfaceName, "memoizedResult", $thisObject) . ";\n"); 3601 3605 push(@implContent, $indent . "} else if (cursor.isReplaying()) {\n");
Note: See TracChangeset
for help on using the changeset viewer.