Add aura::Window::GeWeakPtrAsWindow() This CL moves the WeakPtrFactory from GestureConsumer to subclasses, and define WeakPtr getter for Window type, so that we can use the same factory instance for super class and base casses, but still use WeakPtr<aura::Window> but not WeakPtr<ui::GestureConsumer>. Background: There are increasing report w.r.t. dangling ptr for a window that can be destroyed during a method call. This is to simplify the code to deal with such situation (e.g. using WindowTracker or observers). The weak pointer factory should be the last element in the class structure, and there is no clean way to cast base::WeakPtr<Super> to base::WeakPtr<Sub>. C++ doesn't support covariance for template, so we can't just define base::WeakPtr<aura::Window> GetWeakPtr. And replced WindowTracker that tracks single window with Weakptr. Bug: None Change-Id: Ifc993908f56d34e3b694a9d10e26974097923e7c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7846473 Commit-Queue: Mitsuru Oshima <oshima@chromium.org> Reviewed-by: James Cook <jamescook@chromium.org> Reviewed-by: Keren Zhu <kerenzhu@chromium.org> Cr-Commit-Position: refs/heads/main@{#1630665}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.