Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: media/gpu/avda_codec_allocator.h

Issue 2540593005: media: Fix a flaky AVDACodecAllocator test (Closed)
Patch Set: Add dep for test clock Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/BUILD.gn ('k') | media/gpu/avda_codec_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/avda_codec_allocator.h
diff --git a/media/gpu/avda_codec_allocator.h b/media/gpu/avda_codec_allocator.h
index 796efbbe69c3cdd0cdfaa2493aeb177cc2c6c631..4553ebf9f8c86d79509bb63242b31b5be959613d 100644
--- a/media/gpu/avda_codec_allocator.h
+++ b/media/gpu/avda_codec_allocator.h
@@ -177,18 +177,6 @@ class MEDIA_GPU_EXPORT AVDACodecAllocator {
friend struct base::DefaultLazyInstanceTraits<AVDACodecAllocator>;
friend class AVDACodecAllocatorTest;
- // Things that our unit test needs. We guarantee that we'll access none of
- // it, from any thread, after we are destructed.
- struct TestInformation {
- TestInformation();
- ~TestInformation();
- // Optional clock source.
- std::unique_ptr<base::TickClock> tick_clock_;
-
- // Optional event that we'll signal when stopping the AUTO_CODEC thread.
- std::unique_ptr<base::WaitableEvent> stop_event_;
- };
-
struct OwnerRecord {
AVDACodecAllocatorClient* owner = nullptr;
AVDACodecAllocatorClient* waiter = nullptr;
@@ -220,8 +208,9 @@ class MEDIA_GPU_EXPORT AVDACodecAllocator {
HangDetector hang_detector;
};
- // |test_info| is owned by the unit test.
- AVDACodecAllocator(TestInformation* test_info = nullptr);
+ // |tick_clock| and |stop_event| are for tests only.
+ AVDACodecAllocator(base::TickClock* tick_clock = nullptr,
+ base::WaitableEvent* stop_event = nullptr);
~AVDACodecAllocator();
void OnMediaCodecAndSurfaceReleased(int surface_id);
@@ -245,8 +234,7 @@ class MEDIA_GPU_EXPORT AVDACodecAllocator {
base::ThreadChecker thread_checker_;
- // Optional, used for unit testing. We do not own this.
- TestInformation* test_info_;
+ base::WaitableEvent* stop_event_for_testing_;
// For canceling pending StopThreadTask()s.
base::WeakPtrFactory<AVDACodecAllocator> weak_this_factory_;
« no previous file with comments | « media/gpu/BUILD.gn ('k') | media/gpu/avda_codec_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698