-
Notifications
You must be signed in to change notification settings - Fork 895
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
Make Tor profile an OTR profile associated with the original profile #7069
Conversation
510c3dc
to
ffe04bb
Compare
2e5097e
to
b774945
Compare
b774945
to
c699def
Compare
} | ||
|
||
bool Profile::IsIncognitoProfile() const { | ||
+ BRAVE_IS_INCOGNITO_PROFILE |
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.
Seems like this one can be done via a chromium_src
override.
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.
fixed in d38e8f5db1429052e1130c193f7c3562bbfbc1e1
@@ -6,7 +6,11 @@ | |||
#ifndef BRAVE_CHROMIUM_SRC_CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | |||
#define BRAVE_CHROMIUM_SRC_CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | |||
|
|||
#define BRAVE_BROWSER_CONTEXT_H_ \ |
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.
Maybe use IsOffTheRecord to also define IsTor to avoid the patch?
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 already tried that, it doesn't work with virtual
function
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.
Builds ok for me. I tried:
#define IsOffTheRecord IsTor() const; \ virtual bool IsOffTheRecord
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 know it builds ok, there was a crash when I use define method. But I just tried it now, it doesn't crash anymore so I guess there must be something else fix the issue with the following commits.
Anyway, I will use define instead of patch
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.
fixed in d38e8f5db1429052e1130c193f7c3562bbfbc1e1
4f8b1a0
to
1f00ae3
Compare
|
||
GetLastUsedProfileName) { | ||
g_browser_process->local_state()->SetString( | ||
prefs::kProfileLastUsed, base::FilePath(tor::kTorProfileDir).value()); |
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.
base::FilePath::value() will return a wstring on Windows.
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.
👍 will use AsUTF8Unsafe()
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.
fixed in 1acf6fe166dfd865f8df5ebc59c4d67de0513e85
1f00ae3
to
1e3bab3
Compare
5e1909f
to
3ace81e
Compare
1. Component extension should be allowed in tor 2. InitTorProfileUserPref unittest 3. GetTorProfile refactor
1cf2607
to
6ebf9ec
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.
browser/themes/brave_theme_service.cc : LGTM
browser/brave_browser_main_parts.cc
Outdated
for (Profile* profile : profile_manager->GetLoadedProfiles()) { | ||
const base::FilePath tor_legacy_session_path = | ||
profile->GetPath() | ||
.AppendASCII("session_profiles") |
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 making session_profiles
as a constant instead of hard-cording?
It looks like some places used hard coded string.
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 only used for migration
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.
It also hard coded below.
bool IsSessionProfilePath(const base::FilePath& path) {
return path.DirName().BaseName() ==
base::FilePath(FILE_PATH_LITERAL("session_profiles"));
}
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.
fixed in c4ad0bd
Unrelated browser tests failure
https://ci.brave.com/job/pr-brave-browser-tor-otr-profile-windows/33/execution/node/247/log/ |
c310e8d
to
c4ad0bd
Compare
@@ -23,7 +23,7 @@ const ThemeHelper& GetBraveThemeHelper(Profile* profile) { | |||
#endif | |||
// Because the helper is created as a NoDestructor static, we need separate | |||
// instances for regular vs tor/guest profiles. | |||
if (brave::IsTorProfile(profile) || brave::IsGuestProfile(profile)) { | |||
if (profile->IsTor() || brave::IsGuestProfile(profile)) { |
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.
Hmm, I think I gave a wrong review here.
This returns always false even if current window is tor because ThemeService uses redirected profile.
Fortunately, this will not make any regression to theme service becaue tor profile is also incognito now and incognito and tor uses same theme.
However, I'm not sure other areas have this issue or not.
But my another PR(#6912) needs more work because I need to use different theme colors for private and tor window. :)
Resolves brave/brave-browser#12429
Resolves brave/brave-browser#12470
Resolves brave/brave-browser#12650
This PR migrates Tor session profile to off the record Tor profile created from the regular profile used to create Tor window. Bookmarks, preferences, content settings are shared between regular and tor OTR, just like normal OTR. Extensions are still blocked like what we have in Tor session profile, extensions support will be addressed in different PR. Legacy Tor session profile will be removed during shutdown after upgrade.
It also fixes the issue that multiple Tor profiles opened from different regular profiles don't have correct proxy config
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:
Multiple profiles issue
Open in Tor
link from Guest window doesn't connect to TOR network brave-browser#12470Tor profile migration
[user_data_dir]/Default/session_profiles/Tor Profile
and[user_data_dir]/Profile 1/session_profiles/Tor Profile
should be removedTor Window should act like Private Window with Tor connectivity
Non component extensions blocked
Allow in private
in brave://extensions/Different circuit for different tor profiles
Tor process cleanup
Reviewer Checklist:
After-merge Checklist:
changes has landed on.