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

Unified Diff: webrtc/voice_engine/monitor_module.h

Issue 2722613002: Simplify webrtc::voe::MonitorModule and remove the .cc file. (Closed)
Patch Set: Add TODO Created 3 years, 10 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 | « webrtc/voice_engine/BUILD.gn ('k') | webrtc/voice_engine/monitor_module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/monitor_module.h
diff --git a/webrtc/voice_engine/monitor_module.h b/webrtc/voice_engine/monitor_module.h
index f026f725d504379b0972f3556ad0506723c6a195..ea29d93d804ca4564f83c1cb0a6c81d28d6a910e 100644
--- a/webrtc/voice_engine/monitor_module.h
+++ b/webrtc/voice_engine/monitor_module.h
@@ -11,47 +11,30 @@
#ifndef WEBRTC_VOICE_ENGINE_MONITOR_MODULE_H
#define WEBRTC_VOICE_ENGINE_MONITOR_MODULE_H
-#include "webrtc/base/criticalsection.h"
-#include "webrtc/base/thread_annotations.h"
#include "webrtc/modules/include/module.h"
-#include "webrtc/typedefs.h"
-#include "webrtc/voice_engine/voice_engine_defines.h"
-
-class MonitorObserver
-{
-public:
- virtual void OnPeriodicProcess() = 0;
-protected:
- virtual ~MonitorObserver() {}
-};
-
namespace webrtc {
namespace voe {
-class MonitorModule : public Module
-{
-public:
- int32_t RegisterObserver(MonitorObserver& observer);
-
- int32_t DeRegisterObserver();
-
- MonitorModule();
-
- virtual ~MonitorModule();
-public: // module
- int64_t TimeUntilNextProcess() override;
-
- void Process() override;
-
-private:
- rtc::CriticalSection _callbackCritSect;
- MonitorObserver* _observerPtr GUARDED_BY(_callbackCritSect);
- int64_t _lastProcessTime;
+// When associated with a ProcessThread, calls a callback method
+// |OnPeriodicProcess()| implemented by the |Observer|.
+// TODO(tommi): This could be replaced with PostDelayedTask().
+// Better yet, delete it and delete code related to |_saturationWarning|
+// in TransmitMixer (and the OnPeriodicProcess callback).
+template <typename Observer>
+class MonitorModule : public Module {
+ public:
+ explicit MonitorModule(Observer* observer) : observer_(observer) {}
+ ~MonitorModule() override {}
+
+ private:
+ int64_t TimeUntilNextProcess() override { return 1000; }
+ void Process() override { observer_->OnPeriodicProcess(); }
+
+ Observer* const observer_;
};
} // namespace voe
-
} // namespace webrtc
-#endif // VOICE_ENGINE_MONITOR_MODULE
+#endif // VOICE_ENGINE_MONITOR_MODULE
« no previous file with comments | « webrtc/voice_engine/BUILD.gn ('k') | webrtc/voice_engine/monitor_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698