Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "WebNN: Handle WebNN context lost error"
This is a reland of commit a240af8bb2c11c08a6649388afdd4896818bf336 Included needed fix: 1. Move calling `ID3D12Device::GetDeviceRemovedReason` before calling `WebNNContextImpl::OnLost` which will release the context to avoid UAF for `Adapter`. Because the `Adapter` is referenced by contexts, it will be released when all contexts are released. 2. Remove two invalid cases for `MLContext::writeBuffer` which will call `ID3D12Device::CreateCommittedResource` on DirectML with size 0 to avoid crash. Original change's description: > WebNN: Handle WebNN context lost error > > This CL is to handle the WebNN context lost error and has implemented > for DirectML backend. > > 1. Defined `MLContextLostInfo` dictionary in the WebIDL to expose the > context lost information. > 2. Defined `Promise<MLContextLostInfo> lost` of `MLContext` interface > in the WebIDL, when the lost error is captured, the promise will be > resolved with the `MLContextLostInfo`. > 3. Defined `WebNNContextClient` mojom interface and it's method > `OnLost(string message)` to send the context lost message to > the renderer process when the `MLContext` object lost error in the > GPU process is captured. The renderer process will override this > method to handle the lost error. > 4. Implemented the context lost handling feature in DirectML backend. > > Bug: 40281640, 41492165 > Change-Id: I16775ac8cdbd508e04025c22740d13f01e591b0d > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5602134 > Reviewed-by: Reilly Grant <[email protected]> > Reviewed-by: ningxin hu <[email protected]> > Reviewed-by: Rafael Cintron <[email protected]> > Commit-Queue: Mingming1 Xu <[email protected]> > Cr-Commit-Position: refs/heads/main@{#1322573} Bug: 40281640, 41492165 Change-Id: I3eaeb413c3c10e72416ab2932e182be3a01b99e0 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5673825 Reviewed-by: Alex Gough <[email protected]> Reviewed-by: ningxin hu <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: Mingming1 Xu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1324640}
- Loading branch information