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

Unified Diff: media/base/wall_clock_time_source.h

Issue 562673003: Make media::WallClockTimeSource thread safe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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 | « build/sanitizers/tsan_suppressions.cc ('k') | media/base/wall_clock_time_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/wall_clock_time_source.h
diff --git a/media/base/wall_clock_time_source.h b/media/base/wall_clock_time_source.h
index 87e28af88469153516858b372bdacd1c8d6d36f4..8057746afce0e836de03302d4b8164671570c438 100644
--- a/media/base/wall_clock_time_source.h
+++ b/media/base/wall_clock_time_source.h
@@ -6,6 +6,7 @@
#define MEDIA_BASE_WALL_CLOCK_TIME_SOURCE_H_
#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/lock.h"
#include "media/base/media_export.h"
#include "media/base/time_source.h"
@@ -32,6 +33,8 @@ class MEDIA_EXPORT WallClockTimeSource : public TimeSource {
void SetTickClockForTesting(scoped_ptr<base::TickClock> tick_clock);
private:
+ base::TimeDelta CurrentMediaTime_Locked();
+
scoped_ptr<base::TickClock> tick_clock_;
bool ticking_;
@@ -42,6 +45,10 @@ class MEDIA_EXPORT WallClockTimeSource : public TimeSource {
base::TimeDelta base_time_;
base::TimeTicks reference_wall_ticks_;
+ // TODO(scherkus): Remove internal locking from this class after access to
+ // Renderer::CurrentMediaTime() is single threaded http://crbug.com/370634
+ base::Lock lock_;
+
DISALLOW_COPY_AND_ASSIGN(WallClockTimeSource);
};
« no previous file with comments | « build/sanitizers/tsan_suppressions.cc ('k') | media/base/wall_clock_time_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698