Type is now passed as a constructor param to BookmarkPermanentNode, so updated our subclass to do the same. Added BraveBookmarkNode class that subclasses BookmarkNode and takes Type as a parameter so that we can construct BookmarkNode of types other than URL and FOLDER. Chromium change: https://chromium.googlesource.com/chromium/src/+/91f0b53ac9a6a8ba83be403ed5937598fbb2cb2d commit 91f0b53ac9a6a8ba83be403ed5937598fbb2cb2d Author: Pauline Leitao <psivieroleitao@google.com> Date: Tue Jul 9 10:13:54 2019 +0000 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