diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-02-02 12:21:57 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-02-12 08:13:00 +0000 |
commit | 606d85f2a5386472314d39923da28c70c60dc8e7 (patch) | |
tree | a8f4d7bf997f349f45605e6058259fba0630e4d7 /chromium/media/cdm/library_cdm/clear_key_cdm | |
parent | 5786336dda477d04fb98483dca1a5426eebde2d7 (diff) | |
download | qtwebengine-chromium-606d85f2a5386472314d39923da28c70c60dc8e7.tar.gz |
BASELINE: Update Chromium to 96.0.4664.181
Change-Id: I762cd1da89d73aa6313b4a753fe126c34833f046
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/media/cdm/library_cdm/clear_key_cdm')
8 files changed, 47 insertions, 22 deletions
diff --git a/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_file_adapter.h b/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_file_adapter.h index 6e1391e7a96..1f73507099b 100644 --- a/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_file_adapter.h +++ b/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_file_adapter.h @@ -29,6 +29,10 @@ class CdmFileAdapter : public cdm::FileIOClient { using WriteCB = base::OnceCallback<void(bool success)>; explicit CdmFileAdapter(CdmHostProxy* cdm_host_proxy); + + CdmFileAdapter(const CdmFileAdapter&) = delete; + CdmFileAdapter& operator=(const CdmFileAdapter&) = delete; + ~CdmFileAdapter() override; // Open the file with |name|. |open_cb| will be called when the file is @@ -59,8 +63,6 @@ class CdmFileAdapter : public cdm::FileIOClient { ReadCB read_cb_; WriteCB write_cb_; cdm::FileIO* file_io_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(CdmFileAdapter); }; } // namespace media diff --git a/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_file_io_test.h b/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_file_io_test.h index c2eadf242b1..f5cda65f518 100644 --- a/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_file_io_test.h +++ b/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_file_io_test.h @@ -68,6 +68,10 @@ class FileIOTest : public cdm::FileIOClient { FileIOTest(const CreateFileIOCB& create_file_io_cb, const std::string& test_name); + + FileIOTest(const FileIOTest&) = delete; + FileIOTest& operator=(const FileIOTest&) = delete; + ~FileIOTest() override; // Adds a test step in this test. |this| object doesn't take the ownership of @@ -154,14 +158,16 @@ class FileIOTest : public cdm::FileIOClient { // In the current implementation, all ACTION_* are performed on the latest // opened cdm::FileIO object, hence the stack. base::stack<cdm::FileIO*> file_io_stack_; - - DISALLOW_COPY_AND_ASSIGN(FileIOTest); }; // Tests cdm::FileIO implementation. class FileIOTestRunner { public: explicit FileIOTestRunner(const CreateFileIOCB& create_file_io_cb); + + FileIOTestRunner(const FileIOTestRunner&) = delete; + FileIOTestRunner& operator=(const FileIOTestRunner&) = delete; + ~FileIOTestRunner(); void AddTests(); @@ -180,8 +186,6 @@ class FileIOTestRunner { std::vector<uint8_t> large_data_; size_t total_num_tests_ = 0; // Total number of tests. size_t num_passed_tests_ = 0; // Number of passed tests. - - DISALLOW_COPY_AND_ASSIGN(FileIOTestRunner); }; } // namespace media diff --git a/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_video_decoder.cc b/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_video_decoder.cc index 9fd2daf5cb6..6f15f1ec922 100644 --- a/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_video_decoder.cc +++ b/chromium/media/cdm/library_cdm/clear_key_cdm/cdm_video_decoder.cc @@ -15,6 +15,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/no_destructor.h" +#include "build/build_config.h" #include "third_party/abseil-cpp/absl/types/optional.h" // Necessary to convert async media::VideoDecoder to sync CdmVideoDecoder. // Typically not recommended for production code, but is ok here since @@ -149,8 +150,17 @@ void SetupGlobalEnvironmentIfNeeded() { static base::NoDestructor<base::SingleThreadTaskExecutor> task_executor; } - if (!base::CommandLine::InitializedForCurrentProcess()) + // Initialize CommandLine if not already initialized. Since this is a DLL, + // just use empty arguments. + if (!base::CommandLine::InitializedForCurrentProcess()) { +#if defined(OS_WIN) + // Use InitUsingArgvForTesting() instead of Init() to avoid dependency on + // shell32 API which might not work in the sandbox. See crbug.com/1242710. + base::CommandLine::InitUsingArgvForTesting(0, nullptr); +#else base::CommandLine::Init(0, nullptr); +#endif + } } // Adapts a media::VideoDecoder to a CdmVideoDecoder. Media VideoDecoders @@ -170,6 +180,9 @@ class VideoDecoderAdapter final : public CdmVideoDecoder { DCHECK(cdm_host_proxy_); } + VideoDecoderAdapter(const VideoDecoderAdapter&) = delete; + VideoDecoderAdapter& operator=(const VideoDecoderAdapter&) = delete; + ~VideoDecoderAdapter() final = default; // CdmVideoDecoder implementation. @@ -288,8 +301,6 @@ class VideoDecoderAdapter final : public CdmVideoDecoder { VideoFrameQueue decoded_video_frames_; base::WeakPtrFactory<VideoDecoderAdapter> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(VideoDecoderAdapter); }; } // namespace diff --git a/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_cdm.cc b/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_cdm.cc index 4bbaa85997e..df837cf768c 100644 --- a/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_cdm.cc +++ b/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_cdm.cc @@ -91,8 +91,7 @@ static scoped_refptr<media::DecoderBuffer> CopyDecoderBufferFrom( // TODO(xhwang): Get rid of this copy. scoped_refptr<media::DecoderBuffer> output_buffer = media::DecoderBuffer::CopyFrom(input_buffer.data, input_buffer.data_size); - output_buffer->set_timestamp( - base::TimeDelta::FromMicroseconds(input_buffer.timestamp)); + output_buffer->set_timestamp(base::Microseconds(input_buffer.timestamp)); if (input_buffer.encryption_scheme == cdm::EncryptionScheme::kUnencrypted) return output_buffer; @@ -457,7 +456,7 @@ void ClearKeyCdm::OnUpdateSuccess(uint32_t promise_id, if (!has_set_timer_) { // Make sure the CDM can get time and sleep if necessary. - constexpr auto kSleepDuration = base::TimeDelta::FromSeconds(1); + constexpr auto kSleepDuration = base::Seconds(1); auto start_time = base::Time::Now(); base::PlatformThread::Sleep(kSleepDuration); auto time_elapsed = base::Time::Now() - start_time; diff --git a/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_cdm.h b/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_cdm.h index b48293fce4d..4a70cc7c247 100644 --- a/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_cdm.h +++ b/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_cdm.h @@ -36,6 +36,10 @@ class ClearKeyCdm : public cdm::ContentDecryptionModule_10, public: template <typename HostInterface> ClearKeyCdm(HostInterface* host, const std::string& key_system); + + ClearKeyCdm(const ClearKeyCdm&) = delete; + ClearKeyCdm& operator=(const ClearKeyCdm&) = delete; + ~ClearKeyCdm() override; // cdm::ContentDecryptionModule_10 implementation. @@ -183,8 +187,6 @@ class ClearKeyCdm : public cdm::ContentDecryptionModule_10, bool is_running_output_protection_test_ = false; bool is_running_platform_verification_test_ = false; bool is_running_storage_id_test_ = false; - - DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); }; } // namespace media diff --git a/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_persistent_session_cdm.cc b/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_persistent_session_cdm.cc index a6adbf0d0a0..5baec581809 100644 --- a/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_persistent_session_cdm.cc +++ b/chromium/media/cdm/library_cdm/clear_key_cdm/clear_key_persistent_session_cdm.cc @@ -31,6 +31,12 @@ class NewPersistentSessionCdmPromise : public NewSessionCdmPromise { std::unique_ptr<NewSessionCdmPromise> promise) : session_created_cb_(std::move(session_created_cb)), promise_(std::move(promise)) {} + + NewPersistentSessionCdmPromise(const NewPersistentSessionCdmPromise&) = + delete; + NewPersistentSessionCdmPromise& operator=( + const NewPersistentSessionCdmPromise&) = delete; + ~NewPersistentSessionCdmPromise() override = default; // NewSessionCdmPromise implementation. @@ -50,8 +56,6 @@ class NewPersistentSessionCdmPromise : public NewSessionCdmPromise { private: SessionCreatedCB session_created_cb_; std::unique_ptr<NewSessionCdmPromise> promise_; - - DISALLOW_COPY_AND_ASSIGN(NewPersistentSessionCdmPromise); }; // When a session has been loaded, we need to call FinishUpdate() to complete @@ -64,6 +68,10 @@ class FinishLoadCdmPromise : public SimpleCdmPromise { FinishLoadCdmPromise(const std::string& session_id, std::unique_ptr<NewSessionCdmPromise> promise) : session_id_(session_id), promise_(std::move(promise)) {} + + FinishLoadCdmPromise(const FinishLoadCdmPromise&) = delete; + FinishLoadCdmPromise& operator=(const FinishLoadCdmPromise&) = delete; + ~FinishLoadCdmPromise() override = default; // CdmSimplePromise implementation. @@ -83,8 +91,6 @@ class FinishLoadCdmPromise : public SimpleCdmPromise { private: std::string session_id_; std::unique_ptr<NewSessionCdmPromise> promise_; - - DISALLOW_COPY_AND_ASSIGN(FinishLoadCdmPromise); }; } // namespace diff --git a/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc b/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc index e0a868fe64d..8a78682b70a 100644 --- a/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc +++ b/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc @@ -217,8 +217,7 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer( cdm::AudioFrames* decoded_frames) { DVLOG(1) << "DecodeBuffer()"; const bool is_end_of_stream = !compressed_buffer; - base::TimeDelta timestamp = - base::TimeDelta::FromMicroseconds(input_timestamp); + base::TimeDelta timestamp = base::Microseconds(input_timestamp); if (!is_end_of_stream && timestamp != kNoTimestamp) { if (last_input_timestamp_ != kNoTimestamp && diff --git a/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.h b/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.h index 52e3c5308cd..a7544fdd5e1 100644 --- a/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.h +++ b/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.h @@ -33,6 +33,10 @@ class FFmpegDecodingLoop; class FFmpegCdmAudioDecoder { public: explicit FFmpegCdmAudioDecoder(CdmHostProxy* cdm_host_proxy); + + FFmpegCdmAudioDecoder(const FFmpegCdmAudioDecoder&) = delete; + FFmpegCdmAudioDecoder& operator=(const FFmpegCdmAudioDecoder&) = delete; + ~FFmpegCdmAudioDecoder(); bool Initialize(const cdm::AudioDecoderConfig_2& config); void Deinitialize(); @@ -78,8 +82,6 @@ class FFmpegCdmAudioDecoder { std::unique_ptr<AudioTimestampHelper> output_timestamp_helper_; int bytes_per_frame_ = 0; base::TimeDelta last_input_timestamp_ = kNoTimestamp; - - DISALLOW_COPY_AND_ASSIGN(FFmpegCdmAudioDecoder); }; } // namespace media |