| commit | 91f0b53ac9a6a8ba83be403ed5937598fbb2cb2d | [log] [tgz] |
|---|---|---|
| author | Pauline Leitao <psivieroleitao@google.com> | Tue Jul 09 10:13:54 2019 |
| committer | Commit Bot <commit-bot@chromium.org> | Tue Jul 09 10:13:54 2019 |
| tree | 059e7c168e3cfe7875abafab386a368dac26efde | |
| parent | 8ceae573d080699d4ded482632f55f39e13bc0de [diff] |
Make BookmarkNode type immutable BookmarkNode types are currently mutable and either set with a set_type() method or inferred from URL validity. This CL changes this set-up so that type is defined within the constructor and remains unchanged throughout the existence of the BookmarkNode. This is not only more coherent with the concept of type itself, but also removes the redundancy of calling set_type() after having instantiated a BookmarkNode whose type was already automatically set to the same thing. It also rectifies certain incoherences within other parts of the code, such as the need to re-set permanent node types after decoding them, which had previously caused the BookmarkNode type to be changed to Folder. Objectively, this CL does the following: 1. Changed the main BookmarkNode constructor to take in a type instead of calculating it internally. 2. Changed helper BookmarkNode constructors that take in less parameters to compute node type within them based on URL validity. 3. Additional helper BookmarkNode constructors were added to allow for the creation of nodes with explicit type but not every other parameter. 4. Changed the BookmarkPermanentNode constructor to always take in a type instead of inferring it from other pieces of information. Bug: 980301 Change-Id: Iafb32cbb4c4324f39d505761b3304e6ddaaca807 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1683850 Commit-Queue: Pauline Leitao <psivieroleitao@google.com> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Mohamed Amir Yosef <mamir@chromium.org> Cr-Commit-Position: refs/heads/master@{#675582}
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.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .