Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Brave News]: Build feed off the main thread #21833
[Brave News]: Build feed off the main thread #21833
Changes from all commits
a6dbcb2
920e15a
5b6adc9
6e2884c
f6ed422
e098f7a
0ee8bbf
75d8af6
8530a38
33c1878
d144eaf
6fcd3b7
54f3e0b
aaed2f5
da825ee
c0bb6de
61677ca
c1a7194
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Checking
fetcher
makes sense. Although, the lifetime of the callback could be different.Frankly, I can't 100% sure that we don't add new crashes because posting the callback.
The code use a very callback-based approach. It's really hard to surely find all the entry points and make a conclusion that it's still safe..
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.
Im other words, we changed the public contract of the class. Before we run all the callbacks sync, now we could postpone. A callback could be bound not only to
FeedFetcher
but to a mojo-related interface (to send the answer) or something else. Better to double check all the callers. Or even make renamingDoSomething(..)
=>DoSomethingAsync(..)
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 don't think we have changed the the public contract of the class - the callback was never invoked synchronously, only ever after all the combined feeds and direct feeds are fetched (quite apart from the network request, JSON parsing of the combined feed potentially happens in another process).
I added the check that
fetcher
wasn't destroyed because it was the only place I could think of where the contract was changing (previously the callback wouldn't be invoked if theFeedFetcher
was destroyed, and the WeakPtr check maintains that guarantee).