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

Unified Diff: webrtc/call/rtc_event_log_helper_thread.h

Issue 2035483003: Hibernate the thread if there are no events in the queue. Wake it up when an event is added to the … (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Nit Created 4 years, 7 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
Index: webrtc/call/rtc_event_log_helper_thread.h
diff --git a/webrtc/call/rtc_event_log_helper_thread.h b/webrtc/call/rtc_event_log_helper_thread.h
index 60ed912b65163a22971272c8b9ab05cd4fcc5e89..c506f2843331c3788008a6cbbc47d4a9a2acba7a 100644
--- a/webrtc/call/rtc_event_log_helper_thread.h
+++ b/webrtc/call/rtc_event_log_helper_thread.h
@@ -68,6 +68,7 @@ class RtcEventLogHelperThread final {
SwapQueue<ControlMessage>* message_queue,
SwapQueue<std::unique_ptr<rtclog::Event>>* event_queue,
rtc::Event* wake_up,
+ rtc::Event* end_hibernation,
rtc::Event* file_finished,
const Clock* const clock);
~RtcEventLogHelperThread();
@@ -75,14 +76,12 @@ class RtcEventLogHelperThread final {
private:
static bool ThreadOutputFunction(void* obj);
- void TerminateThread();
bool AppendEventToString(rtclog::Event* event);
- void AppendEventToHistory(const rtclog::Event& event);
- void LogToMemory();
+ int LogToMemory();
pbos-webrtc 2016/06/03 08:56:15 size_t or preferably just a bool for whether it su
terelius 2016/06/08 11:47:29 Changed to bool.
void StartLogFile();
- void LogToFile();
+ int LogToFile();
void StopLogFile();
- void WriteLog();
+ void ProcessEvents();
// Message queues for passing events to the logging thread.
SwapQueue<ControlMessage>* message_queue_;
@@ -109,6 +108,7 @@ class RtcEventLogHelperThread final {
std::string output_string_;
rtc::Event* wake_up_;
+ rtc::Event* end_hibernation_;
pbos-webrtc 2016/06/03 08:51:06 Shouldn't the wake_up_ event be sufficient to sign
terelius 2016/06/08 11:47:29 Both are needed. I renamed them wake_periodically_
rtc::Event* stopped_;
const Clock* const clock_;

Powered by Google App Engine
This is Rietveld 408576698