-
Notifications
You must be signed in to change notification settings - Fork 927
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use override technique for cdm_registry_impl.cc
- Loading branch information
Showing
3 changed files
with
54 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "content/browser/media/cdm_registry_impl.h" | ||
|
||
#if defined(OS_LINUX) | ||
#include <algorithm> | ||
#endif | ||
|
||
#define Init Init_ChromiumImpl | ||
#include "../../../../../content/browser/media/cdm_registry_impl.cc" | ||
#undef Init | ||
|
||
namespace content { | ||
void CdmRegistryImpl::Init() { | ||
Init_ChromiumImpl(); | ||
|
||
#if defined(OS_LINUX) | ||
// On linux, we want to register widevine cdm to CdmRegistry when users opt | ||
// in. Otherwise, widevine is initialized by default w/o user accept. | ||
// So, widevine cdm is erased from |cdms_| and it is registered when users opt | ||
// in. Also, we try to register it during the startup in | ||
// BraveBrowserMainExtraParts::PreMainMessageLoopRun() by checking opted in | ||
// prefs. | ||
cdms_.erase( | ||
std::remove_if(cdms_.begin(), cdms_.end(), [](const CdmInfo& info) { | ||
// It would be better to use |kWidevineKeySystem| constant instead of | ||
// using "com.widevine.alpha". To use constant, it requires adding | ||
// widevine dependency to content module. | ||
// However, using this string directly seems fine because it would not | ||
// be changed and can avoid addtional patching for this. | ||
return info.supported_key_system == "com.widevine.alpha"; | ||
}), | ||
cdms_.end()); | ||
#endif | ||
} | ||
} // namespace content |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/content/browser/media/cdm_registry_impl.h b/content/browser/media/cdm_registry_impl.h | ||
index 303f3c59b3201ab78c84ae3803b48b37d9f8c998..3eac8905fb8ec6a4f4c050bc290f92065894b4f0 100644 | ||
--- a/content/browser/media/cdm_registry_impl.h | ||
+++ b/content/browser/media/cdm_registry_impl.h | ||
@@ -32,6 +32,10 @@ class CONTENT_EXPORT CdmRegistryImpl : public CdmRegistry { | ||
CdmRegistryImpl(); | ||
~CdmRegistryImpl() override; | ||
|
||
+#if defined(BRAVE_CHROMIUM_BUILD) | ||
+ void Init_ChromiumImpl(); | ||
+#endif | ||
+ | ||
std::vector<CdmInfo> cdms_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(CdmRegistryImpl); |