Timeline
Aug 7, 2021:
- 9:18 PM Changeset in webkit [280764] by
-
- 2 edits in trunk/Source/WebCore
UBSan: KeyboardScrollingAnimator.cpp:303:10: runtime error: load of value nnn, which is not a valid value for type 'bool'
<https://webkit.org/b/228901>
Reviewed by Tim Horton.
Covered by running 78 layout tests with UBSan enabled.
- platform/KeyboardScrollingAnimator.h:
- Initialize m_scrollTriggeringKeyIsPressed to false.
- 6:20 PM Changeset in webkit [280763] by
-
- 2 edits in trunk/Tools
[ews] Limit the size of error context buffer
https://bugs.webkit.org/show_bug.cgi?id=228900
Reviewed by Alexey Proskuryakov.
- CISupport/ews-build/steps.py:
(BuildLogLineObserver.outLineReceived): Limit the lines for additional context to 50 lines.
- 3:47 PM Changeset in webkit [280762] by
-
- 7 edits2 adds in trunk
[macOS] Web process crashes when detaching Document with uncommitted marked text
https://bugs.webkit.org/show_bug.cgi?id=228841
rdar://79960890
Reviewed by Ryosuke Niwa.
Source/WebCore:
In the case where the document is in the process of being detached (underneath
willBeRemovedFromFrame()), if
there is currently uncommitted marked text in the document, we will attempt to cancel the IME composition in the
process of clearing out the selection. On macOS, this calls intoEditor::cancelComposition()which
subsequently triggers layout under various call stacks (DOM mutations, text event dispatch, and when scrolling
to reveal the selection); this triggers a security release assertion insideDocument::updateLayout().
To mitigate this, we avoid calling into this codepath if the Document no longer has a living render tree (i.e.,
the render tree has either been destroyed, is being destroyed, or has not been created yet).
Test: editing/inserting/remove-frame-with-marked-text.html
- editing/mac/EditorMac.mm:
(WebCore::Editor::selectionWillChange):
Source/WebKit:
Deploy a similar fix on iOS, to avoid any attempts to compute editor state due to discarding uncommitted marked
text during Document teardown. This is required in order to avoid the same security assertion when running the
new layout test on iOS.
- WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendEditorStateUpdate):
Tools:
Make a small adjustment to DumpRenderTree, such that TextInputController targets the selected frame (or the main
frame, if there is no DOM selection). This behavior matches that of WebKitTestRunner, and allows layout tests
that use TextInputController to simulate setting marked text inside subframes.
- DumpRenderTree/mac/TextInputControllerMac.m:
(-[TextInputController selectedOrMainFrame]):
(-[TextInputController textInput]):
LayoutTests:
Add a layout test to exercise the crash.
- editing/inserting/remove-frame-with-marked-text-expected.txt: Added.
- editing/inserting/remove-frame-with-marked-text.html: Added.
- 3:40 PM Changeset in webkit [280761] by
-
- 4 edits in trunk/Source/JavaScriptCore
Fix ODR violations in JSC
https://bugs.webkit.org/show_bug.cgi?id=228876
Patch by Michael Catanzaro <Michael Catanzaro> on 2021-08-07
Reviewed by Yusuke Suzuki.
When built with LTO enabled, GCC will warn about violations of C++'s one-definition rule.
JSC currently has two violations. The first is JSC::SpeciesConstructResult, which has two
different declarations, one in ArrayPrototype.cpp and the other in
JSArrayBufferPrototype.cpp. I decided to change the version in ArrayPrototype.cpp to make
the declarations match.
The next problem is JSC::SignalContext. We have two different versions of this struct, one
in VMTraps.cpp and the other in SigillCrashAnalyzer.cpp. In this case, I decided to change
the one in VMTraps.cpp from JSC::SignalContext to JSC::VMTraps::SignalContext.
- runtime/ArrayPrototype.cpp:
- runtime/VMTraps.cpp:
(JSC::VMTraps::tryInstallTrapBreakpoints):
- runtime/VMTraps.h:
- 2:38 PM Changeset in webkit [280760] by
-
- 68 edits11 adds in trunk
for-in should only emit one loop in bytecode
https://bugs.webkit.org/show_bug.cgi?id=227989
Reviewed by Yusuke Suzuki.
JSTests:
- microbenchmarks/for-in-double-array-with-own-named.js: Added.
(test):
- microbenchmarks/for-in-double-array.js: Added.
(test):
- microbenchmarks/for-in-getters.js: Added.
(test):
- microbenchmarks/for-in-int32-array-with-own-named.js: Added.
(test):
- microbenchmarks/for-in-int32-array.js: Added.
(test):
- microbenchmarks/for-in-int32-object-with-own-named-and-getters.js: Added.
(test):
- microbenchmarks/for-in-int32-object-with-own-named.js: Added.
(test):
- microbenchmarks/for-in-object-with-own-named.js: Added.
(sum):
(opaqueSet):
- microbenchmarks/for-in-string-array.js: Added.
(test):
- microbenchmarks/for-of-iterate-array-map-set.js: Added.
(sum):
(let.generator):
- stress/for-in-array-mode.js:
(test):
- stress/for-in-base-reassigned-later.js:
- stress/for-in-delete-during-iteration.js:
- stress/for-in-primitive-index-on-prototype.js: Added.
(test):
- stress/for-in-tests.js:
- stress/has-own-property-structure-for-in-loop-correctness.js:
(test5):
Source/JavaScriptCore:
This patch redesigns how we implement for-in loops. Before this patch we would emit three copies of the for-in loop body. One for the indexed properties, one for the named-own properties, and one for generic properties (anything else). This had a couple of problems. Firstly, it meant bytecode size grew exponentially to number of nested for-in loops. This in turn meant DFG/FTL compilation took much longer.
Going off our experience with fast for-of, this patch turns for-in loops specializations into
a "fused" opcode that internally switches on the enumeration mode it currently sees. For example, if we are enumerating an own-named property, the new enumerator_get_by_val bytecode will check the enumerator cell's cached structure matches the base's then load the property offset directly.
There are four new opcodes this patch adds, which replace the various operations we had for the specialized loops previously. The new opcodes are EnumeratorGetByVal, EnumeratorInByVal, EnumeratorHasOwnProperty, and EnumeratorNext. The first three correspond to GetByVal, InByVal, and HasOwnProperty respectively. The EnumeratorNext opcode has three results in bytecode, the next enumeration value's mode, the index of the property name, and the property name string itself. When enumeration is done EnumeratorNext returns JS null as the property name string. Since the DFG doesn't support tuples yet this opcode is spilt into four new nodes. The first computes the updated index and mode for the next enumeration key, which is encoded into a single JS number. Then there are two nodes that extract the mode and index. Finally, the last new node produces the property name string or null based on the extracted mode and index.
Since, in most benchmarks, any given enumeration opcode tends to profile exactly one enumeration mode. This patch focuses primarily on reimplementing all the optimizations we have for any one specific mode. This means there are still potential optimizations for the multi-mode flavors of each new opcode.
The main optimizations implemented for each new opcode are:
EnumeratorNext:
1) IndexedMode loops are loaded and checked for presence inline (DFG/FTL).
2) NamedMode is computed inline as long as the cached structure on the enumerator cell matches the base (Baseline+). This can only differ if there's a transition.
3) property names are extracted from the cached buffer inline (Baseline+).
EnumeratorGetByVal:
EnumeratorInByVal:
EnumeratorHasOwnProperty:
1) IndexedMode has all the optimizations of a normal XByVal on indexed properties (DFG/FTL).
2) NamedMode will extract the value directly from the inline/out-of-line offset if the structure matches the enumerator's (Baseline+).
There are also a few interesting changes worth mentioning here:
1) If a for-in loop would produce an empty enumerator we now always
return the VMs empty enumerator. This has two benefits, most importantly, it distingishes between an unprofiled for-in loop and empty enumeration, which prevents OSR exit loops. Also, it means that the various Enumerator opcodes no longer need to handle undefined/null whentoObjecting the base value.
2) The enumerator now contains a bit set of all the modes it will produce. This removes a few extra branches when speculating on the modes we will see in EnumeratorNext.
3) In the DFG, enumerator GetByVal relies on compileGetByVal to set the result it also passes a prefix callback which emits code after the various cases set up their operands but before code is emitting to help satisfy the branch over register allocation validation. Also, the array mode branch in compileGetByVal passes the data format that it would prefer, which for normal GetByVal is returned. For EnumeratorGetByVal, that preference is completely ignored and it always returns DataFormatJS.
- assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::or8):
- assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::or8):
- assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::rshift64):
(JSC::MacroAssemblerX86_64::or8): Deleted.
- builtins/BuiltinNames.h:
- bytecode/BytecodeList.rb:
- bytecode/BytecodeUseDef.cpp:
(JSC::computeUsesForBytecodeIndexImpl):
(JSC::computeDefsForBytecodeIndexImpl):
- bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
- bytecode/LinkTimeConstant.h:
- bytecode/Opcode.h:
- bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::recordHasOwnPropertyInForInLoop):
(JSC::BytecodeGenerator::emitInByVal):
(JSC::BytecodeGenerator::emitGetByVal):
(JSC::BytecodeGenerator::emitEnumeratorNext):
(JSC::BytecodeGenerator::emitEnumeratorHasOwnProperty):
(JSC::BytecodeGenerator::pushForInScope):
(JSC::BytecodeGenerator::popForInScope):
(JSC::rewriteOp):
(JSC::ForInContext::finalize):
(JSC::BytecodeGenerator::findForInContext):
(JSC::BytecodeGenerator::recordHasOwnStructurePropertyInForInLoop): Deleted.
(JSC::BytecodeGenerator::emitGetEnumerableLength): Deleted.
(JSC::BytecodeGenerator::emitHasEnumerableIndexedProperty): Deleted.
(JSC::BytecodeGenerator::emitHasEnumerableStructureProperty): Deleted.
(JSC::BytecodeGenerator::emitHasEnumerableProperty): Deleted.
(JSC::BytecodeGenerator::emitHasOwnStructureProperty): Deleted.
(JSC::BytecodeGenerator::emitEnumeratorStructurePropertyName): Deleted.
(JSC::BytecodeGenerator::emitEnumeratorGenericPropertyName): Deleted.
(JSC::BytecodeGenerator::emitToIndexString): Deleted.
(JSC::BytecodeGenerator::pushIndexedForInScope): Deleted.
(JSC::BytecodeGenerator::popIndexedForInScope): Deleted.
(JSC::BytecodeGenerator::pushStructureForInScope): Deleted.
(JSC::BytecodeGenerator::popStructureForInScope): Deleted.
(JSC::StructureForInContext::finalize): Deleted.
(JSC::IndexedForInContext::finalize): Deleted.
(JSC::BytecodeGenerator::findStructureForInContext): Deleted.
- bytecompiler/BytecodeGenerator.h:
(JSC::ForInContext::isValid const):
(JSC::ForInContext::invalidate):
(JSC::ForInContext::local const):
(JSC::ForInContext::propertyName const):
(JSC::ForInContext::propertyOffset const):
(JSC::ForInContext::enumerator const):
(JSC::ForInContext::mode const):
(JSC::ForInContext::ForInContext):
(JSC::ForInContext::bodyBytecodeStartOffset const):
(JSC::ForInContext::type const): Deleted.
(JSC::ForInContext::isIndexedForInContext const): Deleted.
(JSC::ForInContext::isStructureForInContext const): Deleted.
(JSC::ForInContext::asIndexedForInContext): Deleted.
(JSC::ForInContext::asStructureForInContext): Deleted.
(JSC::StructureForInContext::StructureForInContext): Deleted.
(JSC::StructureForInContext::index const): Deleted.
(JSC::StructureForInContext::property const): Deleted.
(JSC::StructureForInContext::enumerator const): Deleted.
(JSC::StructureForInContext::baseVariable const): Deleted.
(JSC::StructureForInContext::addGetInst): Deleted.
(JSC::StructureForInContext::addInInst): Deleted.
(JSC::StructureForInContext::addHasOwnPropertyJump): Deleted.
(JSC::IndexedForInContext::IndexedForInContext): Deleted.
(JSC::IndexedForInContext::index const): Deleted.
(JSC::IndexedForInContext::addGetInst): Deleted.
- bytecompiler/NodesCodegen.cpp:
(JSC::HasOwnPropertyFunctionCallDotNode::emitBytecode):
(JSC::ForInNode::emitBytecode):
- dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
- dfg/DFGArrayMode.h:
(JSC::DFG::ArrayMode::isSaneChain const):
- dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
- dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
- dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::injectOSR):
- dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
- dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
- dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
- dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::setJSArraySaneChainIfPossible):
- dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
- dfg/DFGIntegerRangeOptimizationPhase.cpp:
- dfg/DFGMayExit.cpp:
- dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
(JSC::DFG::Node::hasStorageChild const):
(JSC::DFG::Node::storageChildIndex):
(JSC::DFG::Node::hasArrayMode):
(JSC::DFG::Node::hasEnumeratorMetadata const):
(JSC::DFG::Node::enumeratorMetadata):
- dfg/DFGNodeType.h:
- dfg/DFGOpInfo.h:
(JSC::DFG::OpInfo::OpInfo):
- dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
- dfg/DFGOperations.h:
- dfg/DFGPredictionPropagationPhase.cpp:
- dfg/DFGSSALoweringPhase.cpp:
(JSC::DFG::SSALoweringPhase::handleNode):
- dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
- dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::JSValueRegsTemporary::JSValueRegsTemporary):
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
(JSC::DFG::SpeculativeJIT::setIntTypedArrayLoadResult):
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
(JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
(JSC::DFG::SpeculativeJIT::compileGetByValForObjectWithString):
(JSC::DFG::SpeculativeJIT::compileGetByValForObjectWithSymbol):
(JSC::DFG::SpeculativeJIT::compileGetByValOnDirectArguments):
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
(JSC::DFG::SpeculativeJIT::compileEnumeratorNextUpdateIndexAndMode):
(JSC::DFG::SpeculativeJIT::compileEnumeratorNextExtractIndex):
(JSC::DFG::SpeculativeJIT::compileEnumeratorNextExtractMode):
(JSC::DFG::SpeculativeJIT::compileEnumeratorNextUpdatePropertyName):
(JSC::DFG::SpeculativeJIT::compileEnumeratorGetByVal):
(JSC::DFG::SpeculativeJIT::compileEnumeratorHasProperty):
(JSC::DFG::SpeculativeJIT::compileEnumeratorInByVal):
(JSC::DFG::SpeculativeJIT::compileEnumeratorHasOwnProperty):
(JSC::DFG::SpeculativeJIT::compileHasIndexedProperty):
(JSC::DFG::SpeculativeJIT::compileGetEnumerableLength): Deleted.
(JSC::DFG::SpeculativeJIT::compileHasEnumerableProperty): Deleted.
(JSC::DFG::SpeculativeJIT::compileToIndexString): Deleted.
(JSC::DFG::SpeculativeJIT::compileHasEnumerableStructureProperty): Deleted.
(JSC::DFG::SpeculativeJIT::compileHasOwnStructurePropertyImpl): Deleted.
(JSC::DFG::SpeculativeJIT::compileHasOwnStructureProperty): Deleted.
(JSC::DFG::SpeculativeJIT::compileInStructureProperty): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetEnumeratorPname): Deleted.
(JSC::DFG::SpeculativeJIT::compileGetDirectPname): Deleted.
- dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::allocate):
(JSC::DFG::JSValueOperand::regs):
(JSC::DFG::JSValueOperand::gpr):
(JSC::DFG::StorageOperand::StorageOperand):
(JSC::DFG::StorageOperand::~StorageOperand):
(JSC::DFG::StorageOperand::emplace):
(JSC::DFG::JSValueRegsTemporary::operator bool):
(JSC::DFG::JSValueRegsTemporary::JSValueRegsTemporary):
- dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByVal):
(JSC::DFG::SpeculativeJIT::compile):
- dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByVal):
(JSC::DFG::SpeculativeJIT::compile):
- dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks):
(JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks):
- ftl/FTLAbstractHeapRepository.h:
- ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
- ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByValImpl):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAtImpl):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
- ftl/FTLOutput.h:
(JSC::FTL::Output::phi):
- generator/DSL.rb:
- interpreter/Register.h:
- interpreter/RegisterInlines.h:
(JSC::Register::operator=):
- jit/AssemblyHelpers.h:
- jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
- jit/JIT.h:
- jit/JITOpcodes.cpp:
(JSC::JIT::privateCompileHasIndexedProperty):
(JSC::JIT::emit_op_has_structure_propertyImpl): Deleted.
(JSC::JIT::emit_op_has_enumerable_structure_property): Deleted.
(JSC::JIT::emit_op_has_own_structure_property): Deleted.
(JSC::JIT::emit_op_in_structure_property): Deleted.
(JSC::JIT::emit_op_has_enumerable_indexed_property): Deleted.
(JSC::JIT::emitSlow_op_has_enumerable_indexed_property): Deleted.
(JSC::JIT::emit_op_get_direct_pname): Deleted.
(JSC::JIT::emit_op_enumerator_structure_pname): Deleted.
(JSC::JIT::emit_op_enumerator_generic_pname): Deleted.
- jit/JITOpcodes32_64.cpp:
(JSC::JIT::privateCompileHasIndexedProperty):
(JSC::JIT::emit_op_has_structure_propertyImpl): Deleted.
(JSC::JIT::emit_op_has_enumerable_structure_property): Deleted.
(JSC::JIT::emit_op_has_own_structure_property): Deleted.
(JSC::JIT::emit_op_in_structure_property): Deleted.
(JSC::JIT::emit_op_has_enumerable_indexed_property): Deleted.
(JSC::JIT::emitSlow_op_has_enumerable_indexed_property): Deleted.
(JSC::JIT::emit_op_get_direct_pname): Deleted.
(JSC::JIT::emit_op_enumerator_structure_pname): Deleted.
(JSC::JIT::emit_op_enumerator_generic_pname): Deleted.
- jit/JITPropertyAccess.cpp:
(JSC::JIT::generateGetByValSlowCase):
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_enumerator_next):
(JSC::JIT::emit_op_enumerator_get_by_val):
(JSC::JIT::emitSlow_op_enumerator_get_by_val):
(JSC::JIT::emit_enumerator_has_propertyImpl):
(JSC::JIT::emit_op_enumerator_in_by_val):
(JSC::JIT::emit_op_enumerator_has_own_property):
- jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_enumerator_next):
(JSC::JIT::emit_op_enumerator_get_by_val):
(JSC::JIT::emitSlow_op_enumerator_get_by_val):
(JSC::JIT::emit_op_enumerator_in_by_val):
(JSC::JIT::emit_op_enumerator_has_own_property):
- llint/LowLevelInterpreter.asm:
- llint/LowLevelInterpreter64.asm:
- runtime/CommonSlowPaths.cpp:
(JSC::JSC_DEFINE_COMMON_SLOW_PATH):
- runtime/CommonSlowPaths.h:
- runtime/FileBasedFuzzerAgent.cpp:
(JSC::FileBasedFuzzerAgent::getPredictionInternal):
- runtime/FileBasedFuzzerAgentBase.cpp:
(JSC::FileBasedFuzzerAgentBase::opcodeAliasForLookupKey):
- runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
- runtime/JSPropertyNameEnumerator.cpp:
(JSC::JSPropertyNameEnumerator::JSPropertyNameEnumerator):
(JSC::JSPropertyNameEnumerator::computeNext):
- runtime/JSPropertyNameEnumerator.h:
(JSC::propertyNameEnumerator):
- runtime/PredictionFileCreatingFuzzerAgent.cpp:
(JSC::PredictionFileCreatingFuzzerAgent::getPredictionInternal):
- 1:55 PM Changeset in webkit [280759] by
-
- 3 edits in trunk/Tools
[ews] Ensure file handle is not leaked in loadConfig.py
https://bugs.webkit.org/show_bug.cgi?id=228866
Reviewed by Alexey Proskuryakov.
- CISupport/build-webkit-org/loadConfig.py:
(loadBuilderConfig):
- CISupport/ews-build/loadConfig.py:
(loadBuilderConfig):
- 11:50 AM Changeset in webkit [280758] by
-
- 36 edits6 copies in trunk/Source
Deduplicate logging channel algorithms
https://bugs.webkit.org/show_bug.cgi?id=228809
Reviewed by Fujii Hironori.
Source/WebCore:
No new tests because there is no behavior change.
- Sources.txt:
- WebCore.xcodeproj/project.pbxproj:
- accessibility/AXLogger.cpp:
- inspector/agents/page/PageConsoleAgent.cpp:
- page/Page.cpp:
- platform/LogInitialization.cpp: Copied from Source/WebCore/platform/LogInitialization.h.
(WebCore::logChannels):
(WebCore::getLogChannel):
- platform/LogInitialization.h:
- platform/Logging.cpp:
(WebCore::isLogChannelEnabled): Deleted.
(WebCore::setLogChannelToAccumulate): Deleted.
(WebCore::clearAllLogChannelsToAccumulate): Deleted.
(WebCore::initializeLogChannelsIfNecessary): Deleted.
(WebCore::getLogChannel): Deleted.
- platform/Logging.h:
- testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setLogChannelToAccumulate):
(WebCoreTestSupport::clearAllLogChannelsToAccumulate):
(WebCoreTestSupport::initializeLogChannelsIfNecessary):
Source/WebKit:
- GPUProcess/GPUConnectionToWebProcess.cpp:
- GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::initializeGPUProcess):
- Platform/LogInitialization.cpp: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp.
(WebKit::logChannels):
(WebKit::getLogChannel):
- Platform/LogInitialization.h:
- Platform/Logging.cpp:
(WebKit::initializeLogChannelsIfNecessary): Deleted.
(WebKit::getLogChannel): Deleted.
- Platform/Logging.h:
- Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::initialize):
- Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):
- Sources.txt:
- UIProcess/WebPageProxy.cpp:
- UIProcess/WebProcessPool.cpp:
- WebKit.xcodeproj/project.pbxproj:
- WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
Source/WebKitLegacy:
- WebKitLegacy.xcodeproj/project.pbxproj:
Source/WebKitLegacy/mac:
- Misc/WebKitLogInitialization.h: Copied from Source/WebKit/Platform/LogInitialization.h.
- Misc/WebKitLogInitialization.mm: Copied from Source/WebKitLegacy/mac/Misc/WebKitLogging.m.
(WebKit::logChannels):
(ReportDiscardedDelegateException):
- Misc/WebKitLogging.h:
- Misc/WebKitLogging.m:
(ReportDiscardedDelegateException): Deleted.
- WebCoreSupport/WebDragClient.mm:
- WebView/WebDelegateImplementationCaching.mm:
- WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
Source/WTF:
The current infrastructure (before this patch) had the following duplicated for each framework:
- A .cpp file declared the list of logging channels for that framework
- The .cpp file also had algorithms to search, modify, and initialize these logging channels
Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even
duplicated 3 times!)
Because the algorithms directly name their specific list of logging channels, a naive deduplication
would have had to add new parameters to these algorithms to pass in the appropriate framework's
list. That's fine, but this is exactly the sort of thing classes were designed for - classes are
an association of algorithms and data. The algorithms are shared but the data isn't, which really
just means we should have 3 instances of a shared class - one for the 3 sets of data.
So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each
framework has a NeverDestroyed singleton instance of that class. There is a single virtual method
in the class, so the appropriate "default write" variable can be queried for each framework.
The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2
files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h
files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other.
Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the
LogChannels instances are declared in. After this change, the Logging.h files are just for the
declarations of the logging channels themselves, and the LogInitialization.h files are for the
LogChannels instances which contain the searching/modifying/initializing algorithms on the list of
logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and
if you want to search/modify/initialize across the entire list of channels, then #include the
relevant LogInitialization.h file.
- WTF.xcodeproj/project.pbxproj:
- wtf/CMakeLists.txt:
- wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp.
(WTF::LogChannels::isLogChannelEnabled):
(WTF::LogChannels::setLogChannelToAccumulate):
(WTF::LogChannels::clearAllLogChannelsToAccumulate):
(WTF::LogChannels::initializeLogChannelsIfNecessary):
(WTF::LogChannels::getLogChannel):
- wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h.
- 9:34 AM Changeset in webkit [280757] by
-
- 34 edits6 deletes in trunk/Source
Unreviewed, reverting r280756.
https://bugs.webkit.org/show_bug.cgi?id=228897
Broke gtk build
Reverted changeset:
"Deduplicate logging channel algorithms"
https://bugs.webkit.org/show_bug.cgi?id=228809
https://commits.webkit.org/r280756
- 12:54 AM Changeset in webkit [280756] by
-
- 34 edits6 copies in trunk/Source
Deduplicate logging channel algorithms
https://bugs.webkit.org/show_bug.cgi?id=228809
Reviewed by Fujii Hironori.
Source/WebCore:
No new tests because there is no behavior change.
- Sources.txt:
- WebCore.xcodeproj/project.pbxproj:
- accessibility/AXLogger.cpp:
- inspector/agents/page/PageConsoleAgent.cpp:
- page/Page.cpp:
- platform/LogInitialization.cpp: Copied from Source/WebCore/platform/LogInitialization.h.
(WebCore::logChannels):
(WebCore::getLogChannel):
- platform/LogInitialization.h:
- platform/Logging.cpp:
(WebCore::isLogChannelEnabled): Deleted.
(WebCore::setLogChannelToAccumulate): Deleted.
(WebCore::clearAllLogChannelsToAccumulate): Deleted.
(WebCore::initializeLogChannelsIfNecessary): Deleted.
(WebCore::getLogChannel): Deleted.
- platform/Logging.h:
- testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setLogChannelToAccumulate):
(WebCoreTestSupport::clearAllLogChannelsToAccumulate):
(WebCoreTestSupport::initializeLogChannelsIfNecessary):
Source/WebKit:
- GPUProcess/GPUConnectionToWebProcess.cpp:
- GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::initializeGPUProcess):
- Platform/LogInitialization.cpp: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp.
(WebKit::logChannels):
(WebKit::getLogChannel):
- Platform/LogInitialization.h:
- Platform/Logging.cpp:
(WebKit::initializeLogChannelsIfNecessary): Deleted.
(WebKit::getLogChannel): Deleted.
- Platform/Logging.h:
- Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::initialize):
- Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):
- Sources.txt:
- UIProcess/WebPageProxy.cpp:
- UIProcess/WebProcessPool.cpp:
- WebKit.xcodeproj/project.pbxproj:
- WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
Source/WebKitLegacy:
- WebKitLegacy.xcodeproj/project.pbxproj:
Source/WebKitLegacy/mac:
- Misc/WebKitLogInitialization.h: Copied from Source/WebKit/Platform/LogInitialization.h.
- Misc/WebKitLogInitialization.mm: Copied from Source/WebKitLegacy/mac/Misc/WebKitLogging.m.
(WebKit::logChannels):
(ReportDiscardedDelegateException):
- Misc/WebKitLogging.h:
- Misc/WebKitLogging.m:
(ReportDiscardedDelegateException): Deleted.
- WebCoreSupport/WebDragClient.mm:
- WebView/WebDelegateImplementationCaching.mm:
- WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
Source/WTF:
The current infrastructure (before this patch) had the following duplicated for each framework:
- A .cpp file declared the list of logging channels for that framework
- The .cpp file also had algorithms to search, modify, and initialize these logging channels
Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even
duplicated 3 times!)
Because the algorithms directly name their specific list of logging channels, a naive deduplication
would have had to add new parameters to these algorithms to pass in the appropriate framework's
list. That's fine, but this is exactly the sort of thing classes were designed for - classes are
an association of algorithms and data. The algorithms are shared but the data isn't, which really
just means we should have 3 instances of a shared class - one for the 3 sets of data.
So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each
framework has a NeverDestroyed singleton instance of that class. There is a single virtual method
in the class, so the appropriate "default write" variable can be queried for each framework.
The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2
files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h
files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other.
Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the
LogChannels instances are declared in. After this change, the Logging.h files are just for the
declarations of the logging channels themselves, and the LogInitialization.h files are for the
LogChannels instances which contain the searching/modifying/initializing algorithms on the list of
logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and
if you want to search/modify/initialize across the entire list of channels, then #include the
relevant LogInitialization.h file.
- WTF.xcodeproj/project.pbxproj:
- wtf/CMakeLists.txt:
- wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp.
(WTF::LogChannels::isLogChannelEnabled):
(WTF::LogChannels::setLogChannelToAccumulate):
(WTF::LogChannels::clearAllLogChannelsToAccumulate):
(WTF::LogChannels::initializeLogChannelsIfNecessary):
(WTF::LogChannels::getLogChannel):
- wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h.
Aug 6, 2021:
- 11:30 PM Changeset in webkit [280755] by
-
- 1 edit2 adds in trunk/LayoutTests
[SOUP] test imported/w3c/web-platform-tests/html/cross-origin-opener-policy/header-parsing.https.html fails
https://bugs.webkit.org/show_bug.cgi?id=228851
Unreviewed test gardening. Add a GLIB-specific baseline for the
failing subtest
Patch by Arcady Goldmints-Orlov <Arcady Goldmints-Orlov> on 2021-08-06
- platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/header-parsing.https-expected.txt: Added.
- 9:29 PM Changeset in webkit [280754] by
-
- 2 edits in trunk/Source/WebKit
Clarify some identifier naming in RemoteRenderingBackend
https://bugs.webkit.org/show_bug.cgi?id=228886
Reviewed by Said Abou-Hallawa.
Rename some "identifier" variables to differentiate between resource identifiers and
item buffer identifiers.
No behavior change.
- GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::createImageBuffer):
(WebKit::RemoteRenderingBackend::wakeUpAndApplyDisplayList):
(WebKit::RemoteRenderingBackend::cacheNativeImage):
(WebKit::RemoteRenderingBackend::cacheFont):
(WebKit::RemoteRenderingBackend::didCreateSharedDisplayListHandle):
- 9:29 PM Changeset in webkit [280753] by
-
- 2 edits in trunk/Source/WebKit
Page on mhlw.go.jp triggers WebContent termination by GPU process
https://bugs.webkit.org/show_bug.cgi?id=228885
<rdar://81603231>
Reviewed by Wenson Hsieh.
https://www.mhlw.go.jp/stf/seisakunitsuite/bunya/0000164708_00001.html triggered an issue
where RemoteRenderingBackend::finalizeRenderingUpdate() would be called when the
GPU process had just processed a "switching to next item buffer" meta command,
but had not yet received the new item buffer. This triggered the
MESSAGE_CHECK(initialHandle, "Missing initial shared display list handle");
in RemoteRenderingBackend::wakeUpAndApplyDisplayList().
Protect against this by having finalizeRenderingUpdate() check that
arguments.itemBufferIdentifier had been received, which is similar to what happens
inside the loop in wakeUpAndApplyDisplayList() already.
Not easily testable.
- GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::finalizeRenderingUpdate):
- 7:04 PM Changeset in webkit [280752] by
-
- 2 edits in trunk/Source/WebKit
Disable WKHoverPlatter for now
https://bugs.webkit.org/show_bug.cgi?id=228880
Reviewed by Wenson Hsieh.
- UIProcess/ios/WKHoverPlatterParameters.mm:
(-[WKHoverPlatterParameters setDefaultValues]):
Flip the switch.
- 6:39 PM Changeset in webkit [280751] by
-
- 2 edits in trunk/Source/WebKit
REGRESSION (r185111): Links to App Store doesn't work when opening a PDF in Safari on iOS and iPadOS
https://bugs.webkit.org/show_bug.cgi?id=228881
rdar://81294035
Reviewed by Andy Estes.
- WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
Clicking a link in PDF should absolutely be allowed to launch an external app.
Humorously, r185111 applied the correct value to PDFPlugin (macOS), but the
wrong value to WKPDFView (iOS). Bring them into alignment.
- 6:33 PM Changeset in webkit [280750] by
-
- 8 edits in branches/safari-612.1.27.0-branch/Source
Versioning.
WebKit-7612.1.27.0.3
- 6:29 PM Changeset in webkit [280749] by
-
- 2 edits in trunk/LayoutTests
[ Monterey wk2 Release ] fast/scrolling/iframe-scrollable-after-back.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=228200
Unreviewed test gardening. Remove no longer needed expectation.
- platform/mac-wk2/TestExpectations:
- 6:18 PM Changeset in webkit [280748] by
-
- 2 edits in trunk/LayoutTests
[BigSur Release Wk2 Arm64] imported/w3c/web-platform-tests/navigation-timing/test_performance_attributes.sub.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=224784
Unreviewed test gardening. Removing no longer needed expectation.
- platform/mac-wk2/TestExpectations:
- 6:16 PM Changeset in webkit [280747] by
-
- 2 edits in trunk/Source/WebCore
CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::CryptoKeyRSA::exportJwk const
https://bugs.webkit.org/show_bug.cgi?id=228878
<rdar://problem/60147231>
Reviewed by Brent Fulgham.
exportData() could return nullptr. We should check the value of
rsaComponents before trying to use it.
- crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::exportJwk const):
- 5:57 PM Changeset in webkit [280746] by
-
- 2 edits in trunk/LayoutTests
[BigSur Wk2 Arm64] http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=224783
Unreviewed test gardening. Removing no longer needed test expectation.
- platform/mac-wk2/TestExpectations:
- 5:26 PM Changeset in webkit [280745] by
-
- 2 edits in trunk/Source/JavaScriptCore
Unreviewed, build fix on Debug build
https://bugs.webkit.org/show_bug.cgi?id=228810
- yarr/YarrJIT.h:
(JSC::Yarr::BoyerMooreBitmap::addCharacters):
(JSC::Yarr::BoyerMooreBitmap::addRanges):
- 5:02 PM Changeset in webkit [280744] by
-
- 3 edits in trunk/Source/JavaScriptCore
[JSC] Yarr's character tracking for BoyerMoore search should be more precise
https://bugs.webkit.org/show_bug.cgi?id=228810
Reviewed by Saam Barati.
We should track up to 2 candidate characters without masking, so
that we can search a character without masking. To track candidates,
we introduce BoyerMooreCharacterCandidates.
We also add support for m_table because m_table can be used
for important CharacterClass like\s, and still that does not have
many character candidates if the mode is Char8.
To make
\swork on Char8 case, we use Char8 / Char16 information
to filter characters that never appears in BoyreMoore search bitmap
construction.
- yarr/YarrJIT.cpp:
(JSC::Yarr::BoyerMooreInfo::BoyerMooreInfo):
(JSC::Yarr::BoyerMooreInfo::set):
(JSC::Yarr::BoyerMooreInfo::addCharacters):
(JSC::Yarr::BoyerMooreInfo::addRanges):
(JSC::Yarr::BoyerMooreInfo::create):
(JSC::Yarr::BoyerMooreInfo::createCandidateBitmap const):
- yarr/YarrJIT.h:
(JSC::Yarr::BoyerMooreCharacterCandidates::isValid const):
(JSC::Yarr::BoyerMooreCharacterCandidates::invalidate):
(JSC::Yarr::BoyerMooreCharacterCandidates::isEmpty const):
(JSC::Yarr::BoyerMooreCharacterCandidates::size const):
(JSC::Yarr::BoyerMooreCharacterCandidates::at const):
(JSC::Yarr::BoyerMooreCharacterCandidates::add):
(JSC::Yarr::BoyerMooreCharacterCandidates::merge):
(JSC::Yarr::BoyerMooreBitmap::characterCandidates const):
(JSC::Yarr::BoyerMooreBitmap::add):
(JSC::Yarr::BoyerMooreBitmap::addCharacters):
(JSC::Yarr::BoyerMooreBitmap::addRanges):
(JSC::Yarr::BoyerMooreBitmap::isMaskEffective const): Deleted.
- 4:21 PM Changeset in webkit [280743] by
-
- 2 edits in trunk/LayoutTests
[GTK] Remove some expectations for tests that don't fail anymore
https://bugs.webkit.org/show_bug.cgi?id=225644
Unreviewed test gardening.
Patch by Arcady Goldmints-Orlov <Arcady Goldmints-Orlov> on 2021-08-06
- platform/gtk/TestExpectations:
- 4:14 PM Changeset in webkit [280742] by
-
- 2 edits in trunk/Source/WebCore
REGRESSION(r279987): [GTK][WPE] It caused 2 new test failures
https://bugs.webkit.org/show_bug.cgi?id=228160
Reviewed by Michael Catanzaro.
Normally adjustText*() are only called for unstyled elements to adjust their platform
appearance, However, for entries we always call it since
https://bugs.webkit.org/show_bug.cgi?id=173572 and it causes problems.
That change was done for RenderThemeGtk and is not relevant anymore, so we can revert
it.
- rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
- 4:11 PM Changeset in webkit [280741] by
-
- 2 edits in trunk/LayoutTests
[ Monterey Release wk2 arm64 ] platform/mac/fast/overflow/overflow-scrollbar-hit-test.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=228200
Unreviewed test gardening.
- platform/mac-wk2/TestExpectations:
- 3:18 PM Changeset in webkit [280740] by
-
- 3 edits2 adds in trunk
ASSERTION FAILED: !m_networkLoad in NetworkResourceLoader::~NetworkResourceLoader()
https://bugs.webkit.org/show_bug.cgi?id=228853
Reviewed by Alex Christensen.
Source/WebKit:
~NetworkResourceLoader() had the assertion ensuring m_networkLoad
was empty. But, this could fail in the following scenario. If a
'keepalive' fetch request is not finished and the page is
navigated away, its NetworkResourceLoader is transferred to the
NetworkSession by NetworkConnectionToWebProcess::transferKeptAliveLoad.
And, before the request is finished, if the NetworkSession is
destroyed, the kept alive NetworkResourceLoader is destroyed.
Test: http/tests/fetch/keepalive-fetch.html
- NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::~NetworkSession): Abort m_keptAliveLoads.
LayoutTests:
- http/tests/fetch/keepalive-fetch-expected.txt: Added.
- http/tests/fetch/keepalive-fetch.html: Added.
- 3:16 PM Changeset in webkit [280739] by
-
- 11 edits2 adds in trunk/Tools
[git-webkit] Add setup function
https://bugs.webkit.org/show_bug.cgi?id=225985
<rdar://problem/78226729>
Reviewed by Dewei Zhu.
- Scripts/libraries/webkitcorepy/setup.py: Bump version.
- Scripts/libraries/webkitcorepy/webkitcorepy/init.py: Ditto.
- Scripts/libraries/webkitcorepy/webkitcorepy/credentials.py:
(credentials): Key should be pulled from environment variable with key_name in it.
- Scripts/libraries/webkitscmpy/setup.py: Bump version.
- Scripts/libraries/webkitscmpy/webkitscmpy/init.py: Ditto.
- Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py:
(Git): Move config regexes.
(Git.init): Addgit remote add,git configandgit fetch fork.
(Git.config): Add user.email to default configuration.
(Git.edit_config): Modify configuration file.
- Scripts/libraries/webkitscmpy/webkitscmpy/mocks/remote/git_hub.py:
(GitHub): Add list of forks.
(GitHub.enter): Correctly mock token.
(GitHub.request): Add fork check and fork addition.
- Scripts/libraries/webkitscmpy/webkitscmpy/program/init.py:
(main): Add setup function.
- Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py:
(GitHub.credentials): Strip email domain, guide user on token permissions.
- Scripts/libraries/webkitscmpy/webkitscmpy/program/setup.py: Added.
(Setup.github): Ensure that GitHub credentials are in the keychain.
(Setup.git): Set the user for the repository, along with merge strategy.
(Setup.parser):
(Setup.main):
- Scripts/libraries/webkitscmpy/webkitscmpy/test/git_unittest.py:
(test_config): Change user name.
(test_global_config): Ditto.
- Scripts/libraries/webkitscmpy/webkitscmpy/test/setup_unittest.py: Added.
(TestSetup):
(TestSetup.setUp):
(TestSetup.test_svn):
(TestSetup.test_github):
(TestSetup.test_git):
(TestSetup.test_github_checkout):
- 3:13 PM Changeset in webkit [280738] by
-
- 3 edits in trunk/PerformanceTests
MallocBench: fix ODR violation
https://bugs.webkit.org/show_bug.cgi?id=228874
Patch by Michael Catanzaro <Michael Catanzaro> on 2021-08-06
Reviewed by Geoffrey Garen.
When built with LTO enabled, GCC will warn about violations of C++'s one-definition rule.
MallocBench has two different Objects in two different files, which is illegal. We could
rename one of them, but I decided it's simplest to just put them each in anonymous
namespaces in order to restrict them to file scope.
- MallocBench/MallocBench/big.cpp:
- MallocBench/MallocBench/stress.cpp:
- 3:09 PM Changeset in webkit [280737] by
-
- 2 edits in trunk/LayoutTests
[GTK] Mark some WPT CSS tests as still failing on GTK
https://bugs.webkit.org/show_bug.cgi?id=228871
These tests were fixed for most platforms in r279568 and r279698 but
still fail on GTK.
Unreviewed test gardening.
Patch by Arcady Goldmints-Orlov <Arcady Goldmints-Orlov> on 2021-08-06
- platform/gtk/TestExpectations:
- 2:59 PM Changeset in webkit [280736] by
-
- 10 edits in trunk/Source/WebKit
[macOS] 3 second IPC deadlocks involving WebPageProxy::acceptsFirstMouse
https://bugs.webkit.org/show_bug.cgi?id=228834
rdar://75390908
Reviewed by Wenson Hsieh and Tim Horton.
Reports show 3 second hangs in WebPageProxy::acceptsFirstMouse, which is
the timeout for the sync IPC sent by the method. While this method has
always sent a sync IPC, logs show the WebProcess is also blocked on sync
IPC, under WebProcess::ensureGPUProcessConnection.
If a Web<->GPU process connection has not been established,
WebProcess::ensureGPUProcessConnection sends a sync IPC from the
WebProcess to the UIProcess to establish get the connection. However, to
get the connection, the UIProcess then sends an async IPC with a reply
block to the GPUProcess (see GPUProcessProxy::getGPUProcessConnection).
The WebProcess remains blocked until the UIProcess receives the reply
from the GPUProcess, and then sends a reply to the WebProcess.
Now, if a call to acceptsFirstMouse occurs in between the time the async
UIProcess -> GPUProcess IPC is sent, and the reply is received, we will
experience deadlock. The UIProcess will be blocked waiting on the
WebProcess' reply to acceptsFirstMouse, and the reply from the GPUProcess
will not be dispatched. Since the reply from the GPUProcess will not be
dispatched until the UIProcess is unblocked, the WebProcess will be
waiting under WebProcess:ensureGPUProcessConnection, and unable to reply
to acceptsFirstMouse.
A simple fix for the described scenario would be to introduce a
replySendOptions parameter to sendWithAsyncReply, so that the UIProcess
could be re-entered to dispatch the GPUProcess reply, even when waiting
for acceptsFirstMouse. However, this will not work in cases where the
GPUProcess is being launched, due to being blocked on the reply from
xpc_connection_send_message_with_reply in ProcessLauncherMac, which is
before the IPC::Connection has been established.
Since re-entering the UIProcess is not possible in this scenario, given
the existing architecture, the next simplest solution is to re-enter
the WebProcess on acceptsFirstMouse instead. Consequently, one part of
the fix involves sending the acceptsFirstMouse IPC with
IPC::SendOption::DispatchMessageEvenWhenWaitingForUnboundedSyncReply and
tagging WebProcess::getGPUProcessConnection as unbounded sync IPC.
Then, we must also consider the fact that, in the WebProcess,
acceptsFirstMouse performs hit-testing. Hit-testing triggers layout and
could cause script to run. Script could result in a GPUProcess connection
being established, eventually leading us down the path towards the
aforementioned deadlock. To avoid deadlock in this scenario, we need to
interrupt acceptsFirstMouse if a message to get the GPUProcess connection
is received. This is achieved by using waitForAndDispatchImmediately with
the InterruptWaitingIfSyncMessageArrives option, and splitting up
acceptsFirstMouse into two separate IPCs.
- UIProcess/WebPageProxy.h:
- UIProcess/WebPageProxy.messages.in:
- UIProcess/ios/WebPageProxyIOS.mm:
Implementation not required for iOS.
- UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::acceptsFirstMouse):
Send an async IPC with IPC::SendOption::DispatchMessageEvenWhenWaitingForUnboundedSyncReply
so that the WebProcess can be re-entered to resolve deadlock if
necessary. Then, use waitForAndDispatchImmediately to wait for the reply
(essentially making it a sync IPC), so that the wait can be interrupted
if another sync message, such as getGPUProcessConnection, is received.
(WebKit::WebPageProxy::handleAcceptsFirstMouse):
Store the result of the reply from the WebProcess.
- WebProcess/WebPage/WebPage.h:
- WebProcess/WebPage/WebPage.messages.in:
Split the sync IPC into two async IPCs, in order to support the use of
waitForAndDispatchImmediately.
- WebProcess/WebPage/ios/WebPageIOS.mm:
Implementation not required for iOS.
- WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::requestAcceptsFirstMouse):
Exit early if re-entering the WebProcess, to avoid running script on
re-entry.
- WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getGPUProcessConnection):
Tag as unbounded sync IPC, so the WebProcess can be re-entered to
resolve deadlock.
- 2:45 PM Changeset in webkit [280735] by
-
- 1 copy in tags/Safari-612.1.27.0.2
Tag Safari-612.1.27.0.2.
- 1:24 PM Changeset in webkit [280734] by
-
- 2 edits in trunk/Tools
[Win][WebKitTestRunner] WTR::PlatformWebView leaks m_view (WKViewRef)
https://bugs.webkit.org/show_bug.cgi?id=228857
Reviewed by Don Olmstead.
Windows WebKitTestRunner leaked a lot of object because it leaked
WebKit::WebView that retains WebKit::WebPageProxy.
- WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::~PlatformWebView): Release m_view.
- 12:56 PM Changeset in webkit [280733] by
-
- 2 edits in trunk/LayoutTests
Re-baselined imported/w3c/web-platform-tests/html/dom/idlharness.https.html.
https://bugs.webkit.org/show_bug.cgi?id=228751.
Unreviewed test gardening.
- platform/ipad/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
- 12:06 PM Changeset in webkit [280732] by
-
- 4 edits in trunk
[GPUP] Test WebKit2.CrashGPUProcessAfterApplyingConstraints fails when Media in GPU Process is enabled
https://bugs.webkit.org/show_bug.cgi?id=228759
<rdar://problem/81529641>
Reviewed by Geoffrey Garen.
Source/WebCore:
Revert part of https://trac.webkit.org/changeset/279940/webkit.
- platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::sourceSettingsChanged):
Covered by API test.
Tools:
- TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
Reenable test.
- 12:04 PM Changeset in webkit [280731] by
-
- 15 edits in trunk/Source
WebKit::SampleBufferDisplayLayer needs to handle GPUProcess crash
https://bugs.webkit.org/show_bug.cgi?id=228824
<rdar://problem/81564477>
Reviewed by Eric Carlson.
Source/WebCore:
Manually tested.
- platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferDisplayLayerStatusDidChange):
Recreate a new layer if the previous one failed.
Source/WebKit:
Make WebKit::SampleBufferDisplayLayer listen to GPUProcess connection being closed.
When that happens, notify its client that it failed.
- WebProcess/GPU/GPUProcessConnection.cpp:
- WebProcess/GPU/GPUProcessConnection.h:
- WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
- WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
(WebKit::SampleBufferDisplayLayer::create):
(WebKit::SampleBufferDisplayLayer::SampleBufferDisplayLayer):
(WebKit::SampleBufferDisplayLayer::~SampleBufferDisplayLayer):
(WebKit::SampleBufferDisplayLayer::setDidFail):
(WebKit::SampleBufferDisplayLayer::gpuProcessConnectionDidClose):
- WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h:
- WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp:
(WebKit::SampleBufferDisplayLayerManager::createLayer):
- WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.h:
- 12:02 PM Changeset in webkit [280730] by
-
- 2 edits in branches/safari-612.1.27.0-branch/Source/WebKit
Cherry-pick r280722. rdar://problem/81618758
REGRESSION: ASSERTION FAILED: !DeprecatedGlobalSettings::shouldManageAudioSessionCategory() AudioSession::sharedSession().category() == AudioSession::CategoryType::PlayAndRecord https://bugs.webkit.org/show_bug.cgi?id=228847
<rdar://problem/81587101>
Reviewed by Jer Noble.
No new tests, fixes a crashing test.
- UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::SourceProxy::audioUnitWillStart): Restore.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280722 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- 11:24 AM Changeset in webkit [280729] by
-
- 1 copy in tags/Safari-612.1.26.1.4
Tag Safari-612.1.26.1.4.
- 11:19 AM Changeset in webkit [280728] by
-
- 8 edits in branches/safari-612.1.26.1-branch/Source
Versioning.
WebKit-7612.1.26.1.4
- 9:52 AM Changeset in webkit [280727] by
-
- 2 edits in trunk/Source/WebCore
Crash at WebKit::WebPage::requestTextRecognition caused by accessibility invocation.
https://bugs.webkit.org/show_bug.cgi?id=228864
rdar://80679512
Reviewed by Chris Fleizach.
- accessibility/AXImage.cpp:
(WebCore::AXImage::imageOverlayElements):
It was calling requestTextRecognition with *element(), but element() can
return nullptr, which would lead to the crash.
- 9:38 AM Changeset in webkit [280726] by
-
- 14 edits1 delete in trunk
[macOS] Clean up Feature Flags related code
https://bugs.webkit.org/show_bug.cgi?id=228803
<rdar://problem/81142982>
Reviewed by Tim Horton.
Source/WebKit:
On macOS, Safari Technology Preview or a local build WebKit/Safari will always
get the default preference values through the "Feature Flags" SPI. Unfortunately,
this approach won't work if the OS does not provide correct default preference values.
With this patch, we only get default preference values with the SPI for system
WebKit on macOS. For all other cases, we use hardcoded values. So that
WebKit will always get the correct default preference values.
This patch also fixes a few mistakes in two preferences: "webm_webaudio" and "vp8_decoder".
- FeatureFlags/WebKit-appletvos.plist:
- FeatureFlags/WebKit-ios.plist:
- FeatureFlags/WebKit-macos.plist:
- FeatureFlags/WebKit-watchos.plist:
- Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
(WebKit::isFeatureFlagEnabled):
- Shared/WebPreferencesDefaultValues.cpp:
(WebKit::isFeatureFlagEnabled):
(WebKit::defaultAsyncFrameAndOverflowScrollingEnabled):
(WebKit::defaultUseGPUProcessForCanvasRenderingEnabled):
(WebKit::defaultUseGPUProcessForDOMRenderingEnabled):
(WebKit::defaultUseGPUProcessForMediaEnabled):
(WebKit::defaultUseGPUProcessForWebGLEnabled):
(WebKit::defaultCaptureAudioInGPUProcessEnabled):
(WebKit::defaultCaptureVideoInGPUProcessEnabled):
(WebKit::defaultWebRTCCodecsInGPUProcess):
(WebKit::defaultIncrementalPDFEnabled):
(WebKit::defaultWebMFormatReaderEnabled):
(WebKit::defaultVP8DecoderEnabled):
(WebKit::defaultVP9DecoderEnabled):
(WebKit::defaultVP9SWDecoderEnabledOnBattery):
(WebKit::defaultWebMParserEnabled):
(WebKit::defaultWebMWebAudioEnabled):
(WebKit::defaultInAppBrowserPrivacy): Deleted.
- Shared/WebPreferencesDefaultValues.h:
- UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Fix a typo.
Source/WebKitLegacy/mac:
On macOS, Safari Technology Preview or a local build WebKit/Safari will always
get the default preference values through the "Feature Flags" SPI. Unfortunately,
this approach won't work if the OS does not provide correct default preference values.
With this patch, we only get default preference values with the SPI for system
WebKit on macOS. For all other cases, we use hardcoded values. So that
WebKit will always get the correct default preference values.
This patch also fixes a few mistakes in two preferences: "webm_webaudio" and "vp8_decoder".
- WebView/WebPreferencesDefaultValues.h:
- WebView/WebPreferencesDefaultValues.mm:
(WebKit::isFeatureFlagEnabled):
(WebKit::defaultIncrementalPDFEnabled):
(WebKit::defaultWebXREnabled):
(WebKit::defaultWebMParserEnabled):
(WebKit::defaultWebMWebAudioEnabled):
(WebKit::defaultVP8DecoderEnabled):
(WebKit::defaultVP9DecoderEnabled):
LayoutTests:
Update a mac-bigsur specific test expectation file because the test is passing now.
- platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt: Removed.
- platform/mac-bigsur/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt:
- 9:25 AM Changeset in webkit [280725] by
-
- 2 edits in trunk/Tools
[ews] Make config.json compact
https://bugs.webkit.org/show_bug.cgi?id=228862
Reviewed by Jonathan Bedard.
- CISupport/ews-build/config.json:
- 9:03 AM Changeset in webkit [280724] by
-
- 9 edits in branches/safari-612.1.27.0-branch/Source
Cherry-pick r280702. rdar://problem/81618758
[iOS] getUserMedia sometimes doesn't capture from specified microphone
https://bugs.webkit.org/show_bug.cgi?id=228753
rdar://79704226
Reviewed by Youenn Fablet.
Source/WebCore:
The system will always choose the "default" audio input source unless
+[AVAudioSession setPreferredInput:error:] is called first, and that only works
if the audio session category has been set to PlayAndRecord *before* it is called,
so configure the audio session for recording before we choose and configure the
audio capture device.
Tested manually, this only reproduces on hardware.
- platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::activeAudioSessionRequired const): Audio
capture requires an active audio session.
(WebCore::PlatformMediaSessionManager::removeSession): Move
#if USE(AUDIO_SESSION)guard inside of maybeDeactivateAudioSession so it isn't spread throughout the file. (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback): Ditto. (WebCore::PlatformMediaSessionManager::processWillSuspend): Ditto. (WebCore::PlatformMediaSessionManager::processDidResume): Ditto. (WebCore::PlatformMediaSessionManager::sessionCanProduceAudioChanged): Add logging, callmaybeActivateAudioSession()so we activate the audio session if necessary. (WebCore::PlatformMediaSessionManager::addAudioCaptureSource): Call updateSessionState instead of scheduleUpdateSessionState so the audio session category is updated immediately. (WebCore::PlatformMediaSessionManager::maybeDeactivateAudioSession): Move#if USE(AUDIO_SESSION)into the function so it doesn't need to be spread throughout the file. (WebCore::PlatformMediaSessionManager::maybeActivateAudioSession): Ditto. - platform/audio/PlatformMediaSessionManager.h: (WebCore::PlatformMediaSessionManager::isApplicationInBackground const):
- platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSessionIOS::setPreferredBufferSize): Log an error if we are unable to set the preferred buffer size.
- platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
- platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
(WebCore::AVAudioSessionCaptureDeviceManager::setPreferredAudioSessionDeviceUID):
New, set the preferred input so capture will use select the device we want.
(WebCore::AVAudioSessionCaptureDeviceManager::scheduleUpdateCaptureDevices): Remove
m_recomputeDevices,
setAudioCaptureDeviceshas been restructured so we don't need it. (WebCore::AVAudioSessionCaptureDeviceManager::computeCaptureDevices): Ditto. (WebCore::AVAudioSessionCaptureDeviceManager::setAudioCaptureDevices): Don't update the list of capture devices when the default device changes, only when a device is added, removed, enabled, or disabled.
- platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setCaptureDevice): Call
setPreferredAudioSessionDeviceUIDso the correct device is selected. (WebCore::CoreAudioSharedUnit::cleanupAudioUnit): Clear m_persistentID. (WebCore::CoreAudioCaptureSource::create): Return an error with a string, or the web process can detect a failure. (WebCore::CoreAudioCaptureSource::stopProducingData): Add logging.
Source/WebKit:
- UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: Re (WebKit::UserMediaCaptureManagerProxy::SourceProxy::audioUnitWillStart): Delete, we don't need it now that the web process configures the audio session before capture begins.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- 8:09 AM Changeset in webkit [280723] by
-
- 7 edits in trunk/Source
[Cocoa] Remove support for AVAssetImageGenerator
https://bugs.webkit.org/show_bug.cgi?id=228560
<rdar://problem/81336280>
Reviewed by Eric Carlson.
Source/WebCore:
A much more minimal approach to removing support for AVAssetImageGenerator.
The only time we use an AVAssetImageGenerator (as opposed to an AVPlayerItemVideoOutput)
is when the latter does not currently have an available image enqueued. Because painting
is a synchronous operation, we use a synchronous API (the generator) to create an image
for that operation. However, this can create deadlocks if (for example) the resource needs
to load data on the main thread in order to complete the painting operation.
Instead, allow the main runloop to spin while waiting (up to 1_s) for the video output
to receive a decoded frame.
Drive-by fixes:
- Don't create an AVPlayerLayer at AVPlayer-creation; this causes the AVPlayerItemVideoOutput to never receive a decoded frambe (as the layer is not in a CALayer-heirarchy).
- preferredRenderingMode() shouldn't be "none" when the page isn't visible. We already just mark the layer as "hidden" in that case.
- Don't tear down the AVPlayerItemVideoOutput when creating an AVPlayerLayer; it'll just get re-created anyway.
- platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::preferredRenderingMode const):
(WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
- platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
- platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
(WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
(-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
(-[WebCoreAVFPullDelegate setParent:]):
Source/WebKit:
Drive-by fix: we're passing the wrong value into acceleratedRenderingStateChanged(), and
we're not setting the correct initial value on MediaPlayerPrivateRemote creation.
- GPUProcess/media/RemoteMediaPlayerProxy.h:
- WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote):
(WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged):
- 8:04 AM Changeset in webkit [280722] by
-
- 2 edits in trunk/Source/WebKit
REGRESSION: ASSERTION FAILED: !DeprecatedGlobalSettings::shouldManageAudioSessionCategory() AudioSession::sharedSession().category() == AudioSession::CategoryType::PlayAndRecord https://bugs.webkit.org/show_bug.cgi?id=228847
<rdar://problem/81587101>
Reviewed by Jer Noble.
No new tests, fixes a crashing test.
- UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::audioUnitWillStart): Restore.
- 6:42 AM Changeset in webkit [280721] by
-
- 8 edits2 adds in trunk
REGRESSION (r274038): Keyframe animation with top/left with percentages fails to animate
https://bugs.webkit.org/show_bug.cgi?id=228811
<rdar://problem/81568266>
Reviewed by Alan Bujtas.
LayoutTests/imported/w3c:
- web-platform-tests/css/css-position/animations/bottom-composition-expected.txt:
- web-platform-tests/css/css-position/animations/left-composition-expected.txt:
- web-platform-tests/css/css-position/animations/right-composition-expected.txt:
- web-platform-tests/css/css-position/animations/top-composition-expected.txt:
Source/WebCore:
r274038 ended up disabling interpolation of percent values for top/left/bottom/right.
Test: animations/top-left-percent-interpolation.html
- animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
Enable them.
LayoutTests:
- animations/top-left-percent-interpolation-expected.txt: Added.
- animations/top-left-percent-interpolation.html: Added.
- 2:15 AM Changeset in webkit [280720] by
-
- 12 edits2 adds in trunk
MediaPlayerPrivateMediaStreamAVFObjC should skip enqueuing frames when not visible
https://bugs.webkit.org/show_bug.cgi?id=228816
<rdar://81077972>
Reviewed by Eric Carlson.
Source/WebCore:
Do not create layers when not needed.
This prevents enqueuing frames in a AVSampleBufferDisplayLayer that will only buffer them, thus breaking camera capture/video decoding.
We do this by not calling ensureLayers when getting a new track. Instead we react upon player renderingCanBeAccelerated value.
It is also unnecessary and takes CPU cycles to enqueue frames when the video element is not visible.
HTMLMediaElement and RenderVideo thus pass to MediaPlayer a new flag telling whether the video element is visible in the view port.
MediaPlayerPrivateMediaStreamAVFObjC will then skip enqueueing frames if not needed.
Add getter and internals API to cover these changes.
Test: fast/mediastream/mediaPlayer-visibility.html
- html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isVisibleInViewportChanged):
- platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::loadWithNextMediaEngine):
(WebCore::MediaPlayer::setVisibleInViewport):
- platform/graphics/MediaPlayer.h:
- platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setVisibleInViewport):
- platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
- platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVisible):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVisibleInViewport):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
- rendering/RenderVideo.cpp:
(WebCore::RenderVideo::updatePlayer):
- testing/Internals.cpp:
(WebCore::Internals::isPlayerVisibleInViewport const):
- testing/Internals.h:
- testing/Internals.idl:
LayoutTests:
- fast/mediastream/mediaPlayer-visibility-expected.txt: Added.
- fast/mediastream/mediaPlayer-visibility.html: Added.