fix: dangling_raw_ptr warning in electron_api_web_contents (#38403)

fix: dangling_raw_ptr warning in electron_api_web_contents
This commit is contained in:
Charles Kerr 2023-05-23 20:52:07 -05:00 committed by GitHub
parent 30e992dec4
commit b6c80ba646
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -773,9 +773,6 @@ class WebContents : public ExclusiveAccessContext,
// Whether the guest view has been attached.
bool attached_ = false;
// The zoom controller for this webContents.
raw_ptr<WebContentsZoomController> zoom_controller_ = nullptr;
// The type of current WebContents.
Type type_ = Type::kBrowserWindow;
@ -820,6 +817,11 @@ class WebContents : public ExclusiveAccessContext,
// destroyed before dialog_manager_, otherwise a crash would happen.
std::unique_ptr<InspectableWebContents> inspectable_web_contents_;
// The zoom controller for this webContents.
// Note: owned by inspectable_web_contents_, so declare this *after*
// that field to ensure the dtor destroys them in the right order.
raw_ptr<WebContentsZoomController> zoom_controller_ = nullptr;
// Maps url to file path, used by the file requests sent from devtools.
typedef std::map<std::string, base::FilePath> PathsMap;
PathsMap saved_files_;