-
Notifications
You must be signed in to change notification settings - Fork 885
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
Update wrong GOOGLE_CHROME_BUILD usage #3718
Conversation
@kjozwiak, I confirmed that dmg from this PR plays well with netflix. |
@simonhong quickly checked as well, looks like it's generally working. However, noticed that when you initially try playing something on Netflix on a fresh profile, you'll get the following: Once you refresh the page, everything works as expected. Is there a way to have the video play right away without the above error appearing first? |
@kjozwiak It's a known issue and the reason is reloading and installing are trigged in parallel when we click the install button. So, it can happen if reloading is done before install finishes. Maybe we already have issue for it. |
Sadly, there are other places where I missed GOOGLE_CHROME_BUILD usage in our code, though they don't seem to actually affect anything. But mostly, I am not sure if we just want to flip the BUILDFLAG check. Since we are patching anyway, I think, it'd be better to use |
@mkarolin yeah, I agree. it seems better to free from upstream flags. |
@kjozwiak brave/brave-browser#4646 is the reloading issue after installing widevine. |
yup 👍Definitely a known issue and shouldn't block this particular fix. Would be nice to get fixed eventually but as mentioned above, refreshing fixes the problem. |
04a108e
to
c81d5e7
Compare
PrefService* pref_service) { | ||
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) | ||
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || defined(BRAVE_CHROMIUM_BUILD) | ||
return IsMetricsReportingEnabledForOfficialBuild(pref_service); |
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 understand this change, we always want metrics reporting to be 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 has always been enabled for crash reporting.
browser/component_updater/brave_component_updater_configurator.cc
Outdated
Show resolved
Hide resolved
|
||
return result == ERROR_SUCCESS; | ||
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) | ||
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) // NOLINT |
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.
we do not want to enable google updates, I don't understand this change
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.
These aren't functional changes, we had it enabled before.
The only difference is that before C78 this was under
#ifdef GOOGLE_CHROME_BUILD
and we used to define it just for the file (either via patch or via chromium_src).
Now, in C78 they are replacing #ifdef GOOGLE_CHROME_BUILD
with
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
If we wanted to make that enabled for the file, we'd have to expand their macros and do something like
#if defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD) #define BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING 1 #endif
like we did before.
In other places we do patch with the || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) and that gets us away from dependency on their future macro changes.
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.
fyi, we use open source omaha
for windows update.
omaha is opensource version of google update
.
And we reuse most of google update
integration logic in 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.
see comments
c81d5e7
to
f6c41dd
Compare
aadaf6f
to
852b273
Compare
@@ -0,0 +1,51 @@ | |||
/* Copyright (c) 2019 The Brave Authors. All rights reserved. |
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 doesn't seem right, we only added GOOGLE_CHROME_BUILD for part of the file, I don't think we want it defined for the whole file
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 patch had it defined in 41 (after the headers and the other patch) and undefined in line 836 at the end of the file, as far as I can tell.
@@ -185,11 +185,7 @@ BraveConfigurator::GetProtocolHandlerFactory() const { | |||
|
|||
update_client::RecoveryCRXElevator BraveConfigurator::GetRecoveryCRXElevator() | |||
const { | |||
#if defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) |
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.
why is this removed?
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 seems like this was wrong from the start and should have be IS_OFFICIAL_BUILD
for us?
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.
GOOGLE_CHROME_BUILD was never defined for this file, as far as I can see, so the code inside was never used.
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.
@bbondy is going to look into this for a potential follow-up
852b273
to
82a334e
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.
++
Waiting for CI, then can merge |
Fixes brave/brave-browser#6496 Fixes brave/brave-browser#6497 In places we reused GOOGLE_CHROME_BUILD by defining it in particular files (either via chromium_src or by patching). GOOGLE_CHROME_BUILD is being phased out in favor of BUILDFLAG(GOOGLE_CHROME_BRANDING). This fix updates our uses where the transition has already occurred. Chromium changes: Overall issue tracker: https://bugs.chromium.org/p/chromium/issues/detail?id=961769&can=2&q=961769 Some specific changes: https://chromium.googlesource.com/chromium/src/+/0cc7112944131e379a141d8734a77cb50b97e1d5 commit 0cc7112944131e379a141d8734a77cb50b97e1d5 Author: Nico Weber <thakis@chromium.org> Date: Mon Jul 29 17:30:40 2019 +0000 Add BUILDFLAG(GOOGLE_CHROME_BRANDING) and start using it in a few places. Also fix the definition of CHROMIUM_BRANDING; putting a negated condition there doesn't work. Thanks to Yngve Petterson for pointing that out. No behavior change. Bug: 961769 https://chromium.googlesource.com/chromium/src/+/356b304474c643e8064db763b97101100597bddd commit 356b304474c643e8064db763b97101100597bddd Author: Nico Weber <thakis@chromium.org> Date: Fri Aug 23 15:30:41 2019 +0000 Remove all references to GOOGLE_CHROME_BUILD in components/ Bug: 961769
82a334e
to
cf9cd47
Compare
Has a lint error... otherwise looks fine. Going to push a fix for that and verify lint passes, then will merge 👍 |
Tested again on Windows and macOS using https://github.com/brave/brave-browser/releases/tag/v0.73.19 and it worked great 👍 Please ignore the above (maybe the draft build was bad) |
So far, we define explicitly GOOGLE_CHROME_BUILD in some specific source
files to use some code in that define guard.
However, some of them are replaced with
BUILDFLAG(GOOGLE_CHROME_BRANDING).
So, explicit define doesn't work after this change.
fix brave/brave-browser#6497
fix brave/brave-browser#6496
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
After-merge Checklist:
changes has landed on.