Refactor PersistentProto
This CL refactors PersistentProto by achieving the following things: 1. In persistent_proto.h, hide `ReadStatus` and `WriteStatus` in an internal namespace. Because PersistentProto users should not be interested in these low-level details. Actually, users never use `ReadStatus` or `WriteStatus` in the product code. 2. Use the helper classes in base/callback_list.h to replace the std::vector of callbacks. 3. Rename `OnRead` to `OnInit`. Also, update the class comment correspondingly. 4. Remove unnecessary usage of `base::WeakPtrFactory` in the code of PersistentProto users where the protos are owned by users. This CL should not bring any noticeable difference. Bug: b/259442843 Change-Id: I057dde214d0104190df3bc43b6a986afb19f6327 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5324507 Commit-Queue: Andrew Xu <andrewxu@chromium.org> Reviewed-by:CJ Huang <chenjih@google.com> Cr-Commit-Position: refs/heads/main@{#1267309}
Loading