-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support iOS Syncing & Bookmarks #6722
Conversation
00eb778
to
c1d1fbb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super basic first pass, let me know if any of the nits I had conflict with Chromium guidelines
@@ -38,6 +38,7 @@ struct Interface: Hashable, Comparable { | |||
/// The generated output of a this @interface | |||
var generatedPublicInterface: String { | |||
return """ | |||
OBJC_EXPORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file isn't even used anymore :) So this change can be removed. In fact, if you want you can completely delete objc-gen since its done by mojom now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that should probably be a separate PR
e733c17
to
839ff25
Compare
839ff25
to
e5b94d0
Compare
@@ -19,6 +20,7 @@ config("internal_config") { | |||
"-Wno-objc-property-synthesis", | |||
"-Wno-sign-compare", | |||
] | |||
ldflags = [ "-Wl,-no_compact_unwind" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is needed for rust, correct? If so, we should add a rust config and do configs +=
so we can better track what these are used for
fc100ef
to
5de403d
Compare
c39a612
to
be4340f
Compare
be4340f
to
2123454
Compare
25eddb4
to
b88668d
Compare
int64_t internal_value; | ||
base::StringToInt64(time_string, &internal_value); | ||
return Write(base::NumberToString( | ||
base::Time::FromInternalValue(internal_value).ToTimeT())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FromInternalValue
is not recommended anymore (https://source.chromium.org/chromium/chromium/src/+/master:base/time/time.h;l=769?q=FromInternalValue&ss=chromium) and may be deprecated at some point, so we should use something else for deserialization. maybe https://source.chromium.org/chromium/chromium/src/+/master:base/time/time.h;l=617?q=FromDeltaSinceWindowsEpoch&ss=chromium ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diracdeltas this is code copied from upstream, I recommend we keep it as-is to avoid compatibility issues
BookmarkEncoder::~BookmarkEncoder() = default; | ||
|
||
void BookmarkEncoder::UpdateChecksum(const std::string& str) { | ||
base::MD5Update(&md5_context_, str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
md5 is not secure against an attacker who can modify the input to it. it should be ok if it's only used here to check if some data has changed, not for a security-related check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diracdeltas as with the other code I commented on, this is copied from upstream. In this case we should actually be using the original BookmarkCodec class as I mentioned above
GetApplicationContext()->GetChromeBrowserStateManager(); | ||
DCHECK(browserStateManager); | ||
|
||
ChromeBrowserState* chromeBrowserState = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be passed in to the constructor
@@ -73,6 +73,8 @@ OBJC_EXPORT | |||
@property(nonatomic, readonly) NSUInteger childCount; | |||
|
|||
- (nullable IOSBookmarkNode*)childAtIndex:(NSUInteger)index; | |||
- (NSArray<BookmarkFolder*>*)nestedChildFoldersFiltered:(BOOL(^)(BookmarkFolder*))included |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not following what this is supposed to do. Filtered for what? Is there a similar method for android? I definitely think this method needs some comments or a name change because it's not intuitive what is going on here or why this is needed to prevent users from moving parent folders into child folders
Removed duplicate code.
69353a2
to
46a8534
Compare
- (void)moveToParent:(nonnull IOSBookmarkNode*)parent; | ||
- (void)moveToParent:(nonnull IOSBookmarkNode*)parent index:(NSUInteger)index; | ||
- (NSInteger)indexOfChild:(nonnull IOSBookmarkNode*)child; | ||
- (bool)hasAncestor:(nonnull IOSBookmarkNode*)parent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant nonnull
additions
args.enable_stripping = args.enable_dsyms | ||
args.use_xcode_clang = this.isOfficialBuild() | ||
args.enable_stripping = !this.isDebug() | ||
args.use_xcode_clang = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an intentional change, right? Does the 1.15/1.16 forks have this change? Just want to make sure we don't end up having issues submitting to Apple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is intentional. This is what Chromium does for Xcode 12.0+. I explicitly changed this to false
for use_xcode_clang
. I have not tested submitting to Apple's servers but it did pass verification locally.
win had an unrelated intermittent failure |
fix brave/brave-browser#12971
OBJC_EXPORT
Submitter Checklist:
npm run lint
,npm run gn_check
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
After-merge Checklist:
changes has landed on.