Changeset 278782 in webkit
- Timestamp:
- Jun 11, 2021, 2:21:31 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 3 edited
-
ChangeLog (modified) (1 diff)
-
WebCore.xcodeproj/project.pbxproj (modified) (4 diffs)
-
bindings/js/JSDOMBindingSecurityInlines.h (added)
-
bindings/scripts/CodeGeneratorJS.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r278780 r278782 1 2021-06-11 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Add fast-path for binding security check of DOMWindow 4 https://bugs.webkit.org/show_bug.cgi?id=226930 5 6 Reviewed by Geoffrey Garen. 7 8 The security check[1] must pass if the current JSDOMGlobalObject is the same to the accessed JSDOMWindow. 9 This clarification paves the way to emit JIT code which removes this security check when the lexical and 10 accessed JSGlobalObjects are the same. 11 12 [1]: https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl 13 14 * bindings/js/JSDOMBindingSecurity.cpp: 15 (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow): 16 * bindings/js/JSDOMBindingSecurity.h: 17 * bindings/scripts/CodeGeneratorJS.pm: 18 (GenerateAttributeGetterBodyDefinition): 19 (GenerateAttributeSetterBodyDefinition): 20 (GenerateOperationBodyDefinition): 21 1 22 2021-06-11 Jonathan Bedard <jbedard@apple.com> 2 23 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r278738 r278782 5184 5184 E3C99A091DC3D41C00794AD3 /* DOMJITCheckDOM.h in Headers */ = {isa = PBXBuildFile; fileRef = E3C99A081DC3D41700794AD3 /* DOMJITCheckDOM.h */; }; 5185 5185 E3C9AECB2113149900419B92 /* JSMicrotaskCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = E3C9AEC92113147400419B92 /* JSMicrotaskCallback.h */; }; 5186 E3CA0BFC2673F47C009FDD67 /* JSDOMBindingSecurityInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = E3CA0BFA2673F478009FDD67 /* JSDOMBindingSecurityInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5186 5187 E3E4E2A81E3B17100023BB8A /* ScriptElementCachedScriptFetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = E3E4E2A61E3B16FC0023BB8A /* ScriptElementCachedScriptFetcher.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5187 5188 E3FA38641D71812D00AA5950 /* PendingScriptClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E3FA38611D716E7600AA5950 /* PendingScriptClient.h */; }; … … 16530 16531 E3C99A081DC3D41700794AD3 /* DOMJITCheckDOM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMJITCheckDOM.h; sourceTree = "<group>"; }; 16531 16532 E3C9AEC92113147400419B92 /* JSMicrotaskCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMicrotaskCallback.h; sourceTree = "<group>"; }; 16533 E3CA0BFA2673F478009FDD67 /* JSDOMBindingSecurityInlines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSDOMBindingSecurityInlines.h; sourceTree = "<group>"; }; 16532 16534 E3D049931DADC04500718F3C /* NodeConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeConstants.h; sourceTree = "<group>"; }; 16533 16535 E3E4E2A51E3B16FC0023BB8A /* ScriptElementCachedScriptFetcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptElementCachedScriptFetcher.cpp; sourceTree = "<group>"; }; … … 27492 27494 7C45C9CA1E3E8D2E00AAB558 /* JSDOMBindingSecurity.cpp */, 27493 27495 7C45C9C91E3E8CD700AAB558 /* JSDOMBindingSecurity.h */, 27496 E3CA0BFA2673F478009FDD67 /* JSDOMBindingSecurityInlines.h */, 27494 27497 841C4414260C38BA00FF6673 /* JSDOMCastThisValue.h */, 27495 27498 7C45C9CC1E3E8F0800AAB558 /* JSDOMExceptionHandling.cpp */, … … 32641 32644 E0FEF372B17C53EAC1C1FBEE /* EventSource.h in Headers */, 32642 32645 E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */, 32646 E3CA0BFC2673F47C009FDD67 /* JSDOMBindingSecurityInlines.h in Headers */, 32643 32647 84B349A222F86E7500D47BCF /* EventTargetConcrete.h in Headers */, 32644 32648 97AA3CA5145237CC003E1DA6 /* EventTargetHeaders.h in Headers */, -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r278645 r278782 5211 5211 5212 5212 if ($needSecurityCheck) { 5213 AddToImplIncludes("JSDOMBindingSecurity.h", $conditional);5214 5213 if ($interface->type->name eq "DOMWindow") { 5215 push(@$outputArray, " bool shouldAllowAccess = BindingSecurity::shouldAllowAccessToDOMWindow(&lexicalGlobalObject, thisObject.wrapped(), ThrowSecurityError);\n"); 5214 AddToImplIncludes("JSDOMBindingSecurityInlines.h", $conditional); 5215 push(@$outputArray, " bool shouldAllowAccess = BindingSecurity::shouldAllowAccessToDOMWindow(&lexicalGlobalObject, thisObject, ThrowSecurityError);\n"); 5216 5216 } else { 5217 AddToImplIncludes("JSDOMBindingSecurity.h", $conditional); 5217 5218 push(@$outputArray, " bool shouldAllowAccess = BindingSecurity::shouldAllowAccessToDOMWindow(&lexicalGlobalObject, thisObject.wrapped().window(), ThrowSecurityError);\n"); 5218 5219 } … … 5368 5369 5369 5370 if ($needSecurityCheck) { 5370 AddToImplIncludes("JSDOMBindingSecurity.h", $conditional);5371 5371 if ($interface->type->name eq "DOMWindow") { 5372 push(@$outputArray, " bool shouldAllowAccess = BindingSecurity::shouldAllowAccessToDOMWindow(&lexicalGlobalObject, thisObject.wrapped(), ThrowSecurityError);\n"); 5372 AddToImplIncludes("JSDOMBindingSecurityInlines.h", $conditional); 5373 push(@$outputArray, " bool shouldAllowAccess = BindingSecurity::shouldAllowAccessToDOMWindow(&lexicalGlobalObject, thisObject, ThrowSecurityError);\n"); 5373 5374 } else { 5375 AddToImplIncludes("JSDOMBindingSecurity.h", $conditional); 5374 5376 push(@$outputArray, " bool shouldAllowAccess = BindingSecurity::shouldAllowAccessToDOMWindow(&lexicalGlobalObject, thisObject.wrapped().window(), ThrowSecurityError);\n"); 5375 5377 } … … 5580 5582 assert("Security checks are not supported for static operations.") if $operation->isStatic; 5581 5583 5582 AddToImplIncludes("JSDOMBindingSecurity.h", $conditional);5583 5584 if ($interface->type->name eq "DOMWindow") { 5584 push(@$outputArray, " bool shouldAllowAccess = BindingSecurity::shouldAllowAccessToDOMWindow(lexicalGlobalObject, castedThis->wrapped(), ThrowSecurityError);\n"); 5585 AddToImplIncludes("JSDOMBindingSecurityInlines.h", $conditional); 5586 push(@$outputArray, " bool shouldAllowAccess = BindingSecurity::shouldAllowAccessToDOMWindow(lexicalGlobalObject, *castedThis, ThrowSecurityError);\n"); 5585 5587 } else { 5588 AddToImplIncludes("JSDOMBindingSecurity.h", $conditional); 5586 5589 push(@$outputArray, " bool shouldAllowAccess = BindingSecurity::shouldAllowAccessToDOMWindow(lexicalGlobalObject, castedThis->wrapped().window(), ThrowSecurityError);\n"); 5587 5590 }
Note:
See TracChangeset
for help on using the changeset viewer.