Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 6b30b1b2 authored by Carmelo Messina's avatar Carmelo Messina
Browse files

Add menu item to bookmark all tabs: workaround for the occasional crashes when...

Add menu item to bookmark all tabs: workaround for the occasional crashes when closing desktop applications caused by a dangling raw_ptr. I don't notice the same problem on Android.

Currently, all fields in the Chromium bookmark model are marked as “untriaged”, unfortunately since 2022, but they're working on it (https://issues.chromium.org/issues/40212619)
parent a23dc6d7
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
 .../browser/bookmark_load_details.cc          | 15 +++++--
 .../bookmarks/browser/bookmark_load_details.h |  2 +
 .../bookmarks/browser/bookmark_model.cc       |  3 +-
 components/bookmarks/browser/bookmark_model.h |  7 +++
 components/bookmarks/browser/bookmark_model.h |  8 ++++
 components/bookmarks/browser/bookmark_node.cc | 13 ++++++
 components/bookmarks/browser/bookmark_node.h  |  4 ++
 .../bookmarks/browser/bookmark_storage.cc     |  2 +
@@ -31,7 +31,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
 components/bookmarks/browser/bookmark_uuids.h |  1 +
 components/bookmarks/browser/model_loader.cc  |  9 +++-
 .../bookmark_specifics_conversions.cc         |  1 +
 27 files changed, 251 insertions(+), 14 deletions(-)
 27 files changed, 252 insertions(+), 14 deletions(-)

diff --git a/chrome/android/java/res/values/ids.xml b/chrome/android/java/res/values/ids.xml
--- a/chrome/android/java/res/values/ids.xml
@@ -756,14 +756,15 @@ diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmark
   bool is_root_node(const BookmarkNode* node) const {
     DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
     return node == root_;
@@ -638,6 +644,7 @@ class BookmarkModel : public BookmarkUndoProvider,
@@ -633,6 +639,8 @@ class BookmarkModel : public BookmarkUndoProvider,
       nullptr;
   raw_ptr<BookmarkPermanentNode, AcrossTasksDanglingUntriaged> mobile_node_ =
       nullptr;
+  raw_ptr<BookmarkPermanentNode, AcrossTasksDanglingUntriaged> tabs_collection_node_ =
+      nullptr;
 
   // Permanent nodes for account storage.
   raw_ptr<BookmarkPermanentNode> account_bookmark_bar_node_ = nullptr;
   raw_ptr<BookmarkPermanentNode> account_other_node_ = nullptr;
   raw_ptr<BookmarkPermanentNode> account_mobile_node_ = nullptr;
+  raw_ptr<BookmarkPermanentNode> tabs_collection_node_ = nullptr;
 
   // The maximum ID assigned to the bookmark nodes in the model.
   int64_t next_node_id_ = 1;
diff --git a/components/bookmarks/browser/bookmark_node.cc b/components/bookmarks/browser/bookmark_node.cc
--- a/components/bookmarks/browser/bookmark_node.cc
+++ b/components/bookmarks/browser/bookmark_node.cc