-
Notifications
You must be signed in to change notification settings - Fork 920
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
Use widevine component on linux #7228
Conversation
520f34d
to
1754972
Compare
6ef540a
to
9df3896
Compare
e287548
to
6551056
Compare
6551056
to
e64347b
Compare
Hmm, it looks like CI doesn't work well with dedicated b-b branch. will try to run CI again after deleting b-b branch. |
# Widevine CDM is bundled as part of Google Chrome builds. | ||
bundle_widevine_cdm = enable_library_widevine_cdm && is_chrome_branded | ||
+bundle_widevine_cdm = enable_library_widevine_cdm && is_desktop_linux | ||
+enable_widevine_cdm_component = enable_library_widevine_cdm && (is_win || is_mac) |
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 will only enable enable_widevine_cdm_component
for all desktop platform.
test/BUILD.gn
Outdated
"//third_party/widevine/cdm:headers", | ||
] | ||
if (enable_widevine && !is_android) { | ||
sources += [ "//brave/chromium_src/chrome/browser/component_updater/widevine_cdm_component_installer_unittest.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.
Will move this to separate target.
e64347b
to
aa02219
Compare
test/BUILD.gn
Outdated
@@ -652,14 +640,17 @@ if (!is_android) { | |||
"//media:test_support", | |||
] | |||
|
|||
if (enable_widevine && !is_asan) { | |||
if (enable_widevine_cdm_component && !is_asan) { | |||
# Remove the !is_asan check once | |||
# https://github.com/brave/brave-browser/issues/11901 is fixed | |||
sources += [ | |||
"//brave/browser/widevine/widevine_permission_request_browsertest.cc", | |||
"//brave/browser/widevine/widevine_prefs_migration_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.
ditto
aa02219
to
d16a5b5
Compare
83cc26a
to
3a59238
Compare
Ready to review! - |
PTAL! |
// loaded after re-launching. | ||
void CreateDefaultWidevineCdmHintFile() { | ||
base::FilePath hint_file_path; | ||
CHECK(base::PathService::Get(chrome::FILE_COMPONENT_WIDEVINE_CDM_HINT, |
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.
are you sure we should kill the browser?
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.
Yes, cdm lib should be loaded during the zygot initialization before sandboxing.
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's linux-only constraint.
eafea07
to
c3b9d11
Compare
c3b9d11
to
9f1824b
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.
chromium_src
/patches
changes LGTM
9f1824b
to
b755b5e
Compare
Kindly ping :) |
b755b5e
to
4137f21
Compare
browser/brave_drm_tab_helper.h
Outdated
@@ -22,6 +22,10 @@ class BraveDrmTabHelper final | |||
public brave_drm::mojom::BraveDRM, | |||
public component_updater::ComponentUpdateService::Observer { | |||
public: | |||
// Copied from widevine_cdm_component_installer.cc. | |||
// There is no shared constant value. | |||
static char kWidevineComponentId[]; |
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.
const?
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.
done
@@ -16,7 +17,8 @@ class WebContents; | |||
|
|||
class WidevinePermissionRequest : public permissions::PermissionRequest { | |||
public: | |||
explicit WidevinePermissionRequest(content::WebContents* web_contents); | |||
explicit WidevinePermissionRequest(content::WebContents* web_contents, |
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.
not explicit 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.
Fixed.
browser/widevine/widevine_utils.cc
Outdated
} | ||
bool DoDeleteOldWidevineBinary() { | ||
base::FilePath widevine_base_path; | ||
CHECK(base::PathService::Get(chrome::DIR_USER_DATA, |
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 slightly concerned with these CHECK
s, since CHECK
is for critical situation when the browser just cannot work anymore (i.e. detecting a security breach). Inability to delete the widevine binary (or get a path) doesn't look like a critical problem that prevents the program from working
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.
Ok. Changed to early return if it gives false.
Chromium started to support widevine cdm component since c79. Before that, only bundling was supported. So, we've been using our widevine manager for downloading/managing widevine during the runtime. With enabling widevine cdm component, all our codes are deleted.
4137f21
to
9a94d62
Compare
Merged because only unrelated lint & gn check were failed and all are fixed by other PRs. |
So far, we've been using our own widevine downloader because chromium on linux didn't support it via component.
At that time, chrome also only used bundled widevine.
But, chromium started to support to get widevine with component. So, we don't need to use our module for fetching widevine.
If
enable_widevine
is enabled,enable_widevine_cdm_component
is turned on by default for non-google-chrome branding.So, we don't need to touch widevine.gni anymore.
Resolves brave/brave-browser#7081
Resolves brave/brave-browser#7831
Resolves brave/brave-browser#3955
Test scenario:
Test with clean profile
Test with old profile(widevine enabled)
4.10.1610.0
Test case
npm run test brave_unit_tests -- --filter=*Widevine*
npm run test brave_browser_tests --filter=*Widevine*
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed).Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on.
Test Plan:
npm run test brave_unit_tests -- --filter=WidevineBuildFlag.FlagTest