-
Notifications
You must be signed in to change notification settings - Fork 893
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
Refactor tor to brave/components #6881
Conversation
2794dd6
to
36eda0f
Compare
36eda0f
to
d88ec55
Compare
2756623
to
c24c61d
Compare
explicit BraveTorClientUpdaterDelegate(const base::FilePath& user_data_dir); | ||
~BraveTorClientUpdaterDelegate() override; | ||
|
||
// BraveTorClientUpdater::Delegate |
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 tor component can do cleanup and check its disabled state by passing PrefService
(local_state()) and user data dir
to component instead of using Delegate. WDYT?
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 also think this delegate isn't needed.
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.
addressed in 2025088c945de7d44c240623355c7ececb4d6786
@@ -115,9 +115,9 @@ void BraveRenderViewContextMenu::AddSpellCheckServiceItem( | |||
void BraveRenderViewContextMenu::InitMenu() { | |||
RenderViewContextMenu_Chromium::InitMenu(); | |||
|
|||
int index = -1; |
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 might give an unused local variable warning (or error because I think it's treated as an error) under certain conditions.
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.
addressed in 2025088c945de7d44c240623355c7ececb4d6786
lgtm, but I think it'd be good to get rid of the delegate if it's not needed. |
c24c61d
to
2025088
Compare
components/tor/BUILD.gn
Outdated
} | ||
|
||
deps += [ | ||
"//brave/app:brave_generated_resources_grit", |
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 this is layer violoation. If tor components needs resources, it should be included in component resource.
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.
addressed in e1726d757df0524a90d1c7a961847bebc7ed8eee
|
||
namespace tor { | ||
|
||
TorProfileService::TorProfileService() { |
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.
nit: = default
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.
addressed in e1726d757df0524a90d1c7a961847bebc7ed8eee
TorProfileService::TorProfileService() { | ||
} | ||
|
||
TorProfileService::~TorProfileService() { |
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.
nit: = default
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.
addressed in e1726d757df0524a90d1c7a961847bebc7ed8eee
components/tor/tor_switches.h
Outdated
|
||
namespace tor { | ||
|
||
extern const char kDisableTorClientUpdaterExtension[]; |
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.
How about using constexpr
instead of having separated definitions and declaration.
It would be good for compile time optimization.
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.
addressed in e1726d757df0524a90d1c7a961847bebc7ed8eee
test/BUILD.gn
Outdated
@@ -721,6 +711,15 @@ if (!is_android) { | |||
] | |||
} | |||
|
|||
if (enable_tor) { | |||
sources += [ | |||
"//brave/browser/brave_local_state_browsertest.cc", |
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.
How about moving this test into //brave/browser/tor:browser_tests
or unit_test?
This test only checks tor disabled state and I think it would be better to unify related feature's test cases in one place.
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.
addressed in e1726d757df0524a90d1c7a961847bebc7ed8eee
I don't have more comments. Great refactoring 👍 |
except navigation_throttle and tab_helper
and fix minor deps issues
e1726d7
to
62cfbb8
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.
++
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.
chromium_src/patches LGTM
Known issues
https://ci.brave.com/job/pr-brave-browser-components-tor-macos/11/execution/node/249/log/
https://ci.brave.com/job/pr-brave-browser-components-tor-linux/11/execution/node/249/log/ |
Resolves brave/brave-browser#1114
Submitter Checklist:
npm run lint
,npm run gn_check
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).QA/Yes
orQA/No
) to the associated issuerelease-notes/include
orrelease-notes/exclude
) to the associated issueTest Plan:
Reviewer Checklist:
After-merge Checklist:
changes has landed on.