Commit ada0a299 authored by Elad Alon's avatar Elad Alon Committed by Commit Bot

Use templates for some functions in WebRtcEventLogManager

Some functions ended up having more overloaded versions than
is reasonable; templates to the rescue.

1. Move MaybeReply from .h to .cc, made it into a template, and
   used it in a few additional cases.
2. Made MaybeReply take a base::Location&, rather than hard-code
   the location of the helper function itself.
3. Created a template for Reply and ReplyClosure in the unit test
   suite.

Bug: 775415
Change-Id: Ie2c9e31defd045535845d198c658f0859ef99228
Reviewed-on: https://chromium-review.googlesource.com/1114615
Commit-Queue: Elad Alon <eladalon@chromium.org>
Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571101}
parent 1cec50e8
...@@ -53,6 +53,29 @@ const BrowserContext* GetBrowserContext(int render_process_id) { ...@@ -53,6 +53,29 @@ const BrowserContext* GetBrowserContext(int render_process_id) {
return host ? host->GetBrowserContext() : nullptr; return host ? host->GetBrowserContext() : nullptr;
} }
// Post reply back if non-empty.
template <typename... Args>
inline void MaybeReply(const base::Location& location,
base::OnceCallback<void(Args...)> reply,
Args... args) {
if (reply) {
BrowserThread::PostTask(BrowserThread::UI, location,
base::BindOnce(std::move(reply), args...));
}
}
// No style-guide-permited way of forcing const-ref inference at the moment.
inline void MaybeReply(const base::Location& location,
base::OnceCallback<void(bool, const std::string&)> reply,
bool bool_val,
const std::string& str_val) {
if (reply) {
BrowserThread::PostTask(
BrowserThread::UI, location,
base::BindOnce(std::move(reply), bool_val, str_val));
}
}
} // namespace } // namespace
const size_t kWebRtcEventLogManagerUnlimitedFileSize = 0; const size_t kWebRtcEventLogManagerUnlimitedFileSize = 0;
...@@ -162,7 +185,7 @@ void WebRtcEventLogManager::PeerConnectionAdded( ...@@ -162,7 +185,7 @@ void WebRtcEventLogManager::PeerConnectionAdded(
RenderProcessHost* rph = RenderProcessHost::FromID(render_process_id); RenderProcessHost* rph = RenderProcessHost::FromID(render_process_id);
if (!rph) { if (!rph) {
// RPH died before processing of this notification. // RPH died before processing of this notification.
MaybeReply(std::move(reply), false); MaybeReply(FROM_HERE, std::move(reply), false);
return; return;
} }
...@@ -198,7 +221,7 @@ void WebRtcEventLogManager::PeerConnectionRemoved( ...@@ -198,7 +221,7 @@ void WebRtcEventLogManager::PeerConnectionRemoved(
if (browser_context_id == kNullBrowserContextId) { if (browser_context_id == kNullBrowserContextId) {
// RPH died before processing of this notification. This is handled by // RPH died before processing of this notification. This is handled by
// RenderProcessExited() / RenderProcessHostDestroyed. // RenderProcessExited() / RenderProcessHostDestroyed.
MaybeReply(std::move(reply), false); MaybeReply(FROM_HERE, std::move(reply), false);
return; return;
} }
...@@ -263,7 +286,7 @@ void WebRtcEventLogManager::OnWebRtcEventLogWrite( ...@@ -263,7 +286,7 @@ void WebRtcEventLogManager::OnWebRtcEventLogWrite(
const BrowserContext* browser_context = GetBrowserContext(render_process_id); const BrowserContext* browser_context = GetBrowserContext(render_process_id);
if (!browser_context) { if (!browser_context) {
// RPH died before processing of this notification. // RPH died before processing of this notification.
MaybeReply(std::move(reply), false, false); MaybeReply(FROM_HERE, std::move(reply), std::make_pair(false, false));
return; return;
} }
...@@ -290,25 +313,22 @@ void WebRtcEventLogManager::StartRemoteLogging( ...@@ -290,25 +313,22 @@ void WebRtcEventLogManager::StartRemoteLogging(
base::OnceCallback<void(bool, const std::string&)> reply) { base::OnceCallback<void(bool, const std::string&)> reply) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!remote_logs_manager_) {
MaybeReply(std::move(reply), false,
std::string(kStartRemoteLoggingFailureFeatureDisabled));
return;
}
const BrowserContext* browser_context = GetBrowserContext(render_process_id); const BrowserContext* browser_context = GetBrowserContext(render_process_id);
if (!browser_context) { const char* error = nullptr;
// RPH died before processing of this notification.
MaybeReply(std::move(reply), false,
std::string(kStartRemoteLoggingFailureGeneric));
return;
}
if (browser_context->IsOffTheRecord()) { if (!remote_logs_manager_) {
error = kStartRemoteLoggingFailureFeatureDisabled;
} else if (!browser_context) {
// RPH died before processing of this notification.
error = kStartRemoteLoggingFailureGeneric;
} else if (browser_context->IsOffTheRecord()) {
// Feature disable in incognito. Since the feature can be disabled for // Feature disable in incognito. Since the feature can be disabled for
// non-incognito sessions, this should not expose incognito mode. // non-incognito sessions, this should not expose incognito mode.
MaybeReply(std::move(reply), false, error = kStartRemoteLoggingFailureFeatureDisabled;
std::string(kStartRemoteLoggingFailureFeatureDisabled)); }
if (error) {
MaybeReply(FROM_HERE, std::move(reply), false, std::string(error));
return; return;
} }
...@@ -505,9 +525,7 @@ void WebRtcEventLogManager::EnableForBrowserContextInternal( ...@@ -505,9 +525,7 @@ void WebRtcEventLogManager::EnableForBrowserContextInternal(
browser_context_dir); browser_context_dir);
} }
if (reply) { MaybeReply(FROM_HERE, std::move(reply));
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, std::move(reply));
}
} }
void WebRtcEventLogManager::DisableForBrowserContextInternal( void WebRtcEventLogManager::DisableForBrowserContextInternal(
...@@ -519,9 +537,7 @@ void WebRtcEventLogManager::DisableForBrowserContextInternal( ...@@ -519,9 +537,7 @@ void WebRtcEventLogManager::DisableForBrowserContextInternal(
remote_logs_manager_->DisableForBrowserContext(browser_context_id); remote_logs_manager_->DisableForBrowserContext(browser_context_id);
} }
if (reply) { MaybeReply(FROM_HERE, std::move(reply));
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, std::move(reply));
}
} }
void WebRtcEventLogManager::PeerConnectionAddedInternal( void WebRtcEventLogManager::PeerConnectionAddedInternal(
...@@ -538,10 +554,7 @@ void WebRtcEventLogManager::PeerConnectionAddedInternal( ...@@ -538,10 +554,7 @@ void WebRtcEventLogManager::PeerConnectionAddedInternal(
DCHECK_EQ(local_result, remote_result); DCHECK_EQ(local_result, remote_result);
} }
if (reply) { MaybeReply(FROM_HERE, std::move(reply), local_result);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(std::move(reply), local_result));
}
} }
void WebRtcEventLogManager::PeerConnectionRemovedInternal( void WebRtcEventLogManager::PeerConnectionRemovedInternal(
...@@ -555,10 +568,7 @@ void WebRtcEventLogManager::PeerConnectionRemovedInternal( ...@@ -555,10 +568,7 @@ void WebRtcEventLogManager::PeerConnectionRemovedInternal(
DCHECK_EQ(local_result, remote_result); DCHECK_EQ(local_result, remote_result);
} }
if (reply) { MaybeReply(FROM_HERE, std::move(reply), local_result);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(std::move(reply), local_result));
}
} }
void WebRtcEventLogManager::EnableLocalLoggingInternal( void WebRtcEventLogManager::EnableLocalLoggingInternal(
...@@ -570,10 +580,7 @@ void WebRtcEventLogManager::EnableLocalLoggingInternal( ...@@ -570,10 +580,7 @@ void WebRtcEventLogManager::EnableLocalLoggingInternal(
const bool result = const bool result =
local_logs_manager_.EnableLogging(base_path, max_file_size_bytes); local_logs_manager_.EnableLogging(base_path, max_file_size_bytes);
if (reply) { MaybeReply(FROM_HERE, std::move(reply), result);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(std::move(reply), result));
}
} }
void WebRtcEventLogManager::DisableLocalLoggingInternal( void WebRtcEventLogManager::DisableLocalLoggingInternal(
...@@ -582,10 +589,7 @@ void WebRtcEventLogManager::DisableLocalLoggingInternal( ...@@ -582,10 +589,7 @@ void WebRtcEventLogManager::DisableLocalLoggingInternal(
const bool result = local_logs_manager_.DisableLogging(); const bool result = local_logs_manager_.DisableLogging();
if (reply) { MaybeReply(FROM_HERE, std::move(reply), result);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(std::move(reply), result));
}
} }
void WebRtcEventLogManager::OnWebRtcEventLogWriteInternal( void WebRtcEventLogManager::OnWebRtcEventLogWriteInternal(
...@@ -601,12 +605,8 @@ void WebRtcEventLogManager::OnWebRtcEventLogWriteInternal( ...@@ -601,12 +605,8 @@ void WebRtcEventLogManager::OnWebRtcEventLogWriteInternal(
? remote_logs_manager_->EventLogWrite(key, message) ? remote_logs_manager_->EventLogWrite(key, message)
: false; : false;
if (reply) { MaybeReply(FROM_HERE, std::move(reply),
BrowserThread::PostTask( std::make_pair(local_result, remote_result));
BrowserThread::UI, FROM_HERE,
base::BindOnce(std::move(reply),
std::make_pair(local_result, remote_result)));
}
} }
void WebRtcEventLogManager::StartRemoteLoggingInternal( void WebRtcEventLogManager::StartRemoteLoggingInternal(
...@@ -624,11 +624,8 @@ void WebRtcEventLogManager::StartRemoteLoggingInternal( ...@@ -624,11 +624,8 @@ void WebRtcEventLogManager::StartRemoteLoggingInternal(
browser_context_dir, max_file_size_bytes, &error_message); browser_context_dir, max_file_size_bytes, &error_message);
DCHECK_EQ(result, error_message.empty()); // Error set iff has failed. DCHECK_EQ(result, error_message.empty()); // Error set iff has failed.
if (reply) { MaybeReply(FROM_HERE,
BrowserThread::PostTask( base::BindOnce(std::move(reply), result, error_message));
BrowserThread::UI, FROM_HERE,
base::BindOnce(std::move(reply), result, error_message));
}
} }
void WebRtcEventLogManager::ClearCacheForBrowserContextInternal( void WebRtcEventLogManager::ClearCacheForBrowserContextInternal(
...@@ -675,45 +672,6 @@ void WebRtcEventLogManager::SetRemoteLogsObserverInternal( ...@@ -675,45 +672,6 @@ void WebRtcEventLogManager::SetRemoteLogsObserverInternal(
} }
} }
void WebRtcEventLogManager::MaybeReply(base::OnceClosure reply) {
if (!reply) {
return;
}
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, std::move(reply));
}
void WebRtcEventLogManager::MaybeReply(base::OnceCallback<void(bool)> reply,
bool value) {
if (!reply) {
return;
}
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(std::move(reply), value));
}
void WebRtcEventLogManager::MaybeReply(
base::OnceCallback<void(bool, const std::string&)> reply,
bool bool_val,
const std::string& str_val) {
if (!reply) {
return;
}
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(std::move(reply), bool_val, str_val));
}
void WebRtcEventLogManager::MaybeReply(
base::OnceCallback<void(std::pair<bool, bool>)> reply,
bool first,
bool second) {
if (!reply) {
return;
}
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::BindOnce(std::move(reply), std::make_pair(first, second)));
}
void WebRtcEventLogManager::SetClockForTesting(base::Clock* clock, void WebRtcEventLogManager::SetClockForTesting(base::Clock* clock,
base::OnceClosure reply) { base::OnceClosure reply) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
......
...@@ -247,16 +247,6 @@ class WebRtcEventLogManager final : public content::RenderProcessHostObserver, ...@@ -247,16 +247,6 @@ class WebRtcEventLogManager final : public content::RenderProcessHostObserver,
void SetRemoteLogsObserverInternal(WebRtcRemoteEventLogsObserver* observer, void SetRemoteLogsObserverInternal(WebRtcRemoteEventLogsObserver* observer,
base::OnceClosure reply); base::OnceClosure reply);
// Non-empty replies get posted to BrowserThread::UI.
void MaybeReply(base::OnceClosure reply);
void MaybeReply(base::OnceCallback<void(bool)> reply, bool value);
void MaybeReply(base::OnceCallback<void(bool, const std::string&)> reply,
bool bool_val,
const std::string& str_val);
void MaybeReply(base::OnceCallback<void(std::pair<bool, bool>)> reply,
bool first,
bool second);
// Injects a fake clock, to be used by tests. For example, this could be // Injects a fake clock, to be used by tests. For example, this could be
// used to inject a frozen clock, thereby allowing unit tests to know what a // used to inject a frozen clock, thereby allowing unit tests to know what a
// local log's filename would end up being. // local log's filename would end up being.
......
...@@ -250,49 +250,50 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> { ...@@ -250,49 +250,50 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> {
run_loop_.reset(new base::RunLoop); // Allow re-blocking. run_loop_.reset(new base::RunLoop); // Allow re-blocking.
} }
void VoidReply() { run_loop_->QuitWhenIdle(); } void Reply() { run_loop_->QuitWhenIdle(); }
base::OnceClosure VoidReplyClosure() { base::OnceClosure ReplyClosure() {
return base::BindOnce(&WebRtcEventLogManagerTestBase::VoidReply, // Intermediary pointer used to help the compiler distinguish between
base::Unretained(this)); // the overloaded Reply() functions.
void (WebRtcEventLogManagerTestBase::*function)() =
&WebRtcEventLogManagerTestBase::Reply;
return base::BindOnce(function, base::Unretained(this));
} }
void BoolReply(bool* output, bool value) { template <typename T>
*output = value; void Reply(T* output, T val) {
*output = val;
run_loop_->QuitWhenIdle(); run_loop_->QuitWhenIdle();
} }
base::OnceCallback<void(bool)> BoolReplyClosure(bool* output) { template <typename T>
return base::BindOnce(&WebRtcEventLogManagerTestBase::BoolReply, base::OnceCallback<void(T)> ReplyClosure(T* output) {
base::Unretained(this), output); // Intermediary pointer used to help the compiler distinguish between
// the overloaded Reply() functions.
void (WebRtcEventLogManagerTestBase::*function)(T*, T) =
&WebRtcEventLogManagerTestBase::Reply;
return base::BindOnce(function, base::Unretained(this), output);
} }
void BoolAndStringReply(bool* output_bool, void Reply(bool* output_bool,
std::string* output_str, std::string* output_str,
bool bool_val, bool bool_val,
const std::string& str_val) { const std::string& str_val) {
*output_bool = bool_val; *output_bool = bool_val;
*output_str = str_val; *output_str = str_val;
run_loop_->QuitWhenIdle(); run_loop_->QuitWhenIdle();
} }
base::OnceCallback<void(bool, const std::string&)> BoolAndStringReplyClosure( base::OnceCallback<void(bool, const std::string&)> ReplyClosure(
bool* output_bool, bool* output_bool,
std::string* output_str) { std::string* output_str) {
return base::BindOnce(&WebRtcEventLogManagerTestBase::BoolAndStringReply, // Intermediary pointer used to help the compiler distinguish between
base::Unretained(this), output_bool, output_str); // the overloaded Reply() functions.
} void (WebRtcEventLogManagerTestBase::*function)(bool*, std::string*, bool,
const std::string&) =
void BoolPairReply(std::pair<bool, bool>* output, &WebRtcEventLogManagerTestBase::Reply;
std::pair<bool, bool> value) { return base::BindOnce(function, base::Unretained(this), output_bool,
*output = value; output_str);
run_loop_->QuitWhenIdle();
}
base::OnceCallback<void(std::pair<bool, bool>)> BoolPairReplyClosure(
std::pair<bool, bool>* output) {
return base::BindOnce(&WebRtcEventLogManagerTestBase::BoolPairReply,
base::Unretained(this), output);
} }
bool PeerConnectionAdded(int render_process_id, bool PeerConnectionAdded(int render_process_id,
...@@ -306,7 +307,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> { ...@@ -306,7 +307,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> {
bool result; bool result;
event_log_manager_->PeerConnectionAdded( event_log_manager_->PeerConnectionAdded(
render_process_id, lid, peer_connection_id, BoolReplyClosure(&result)); render_process_id, lid, peer_connection_id, ReplyClosure(&result));
WaitForReply(); WaitForReply();
return result; return result;
} }
...@@ -314,7 +315,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> { ...@@ -314,7 +315,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> {
bool PeerConnectionRemoved(int render_process_id, int lid) { bool PeerConnectionRemoved(int render_process_id, int lid) {
bool result; bool result;
event_log_manager_->PeerConnectionRemoved(render_process_id, lid, event_log_manager_->PeerConnectionRemoved(render_process_id, lid,
BoolReplyClosure(&result)); ReplyClosure(&result));
WaitForReply(); WaitForReply();
return result; return result;
} }
...@@ -322,7 +323,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> { ...@@ -322,7 +323,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> {
bool PeerConnectionStopped(int render_process_id, int lid) { bool PeerConnectionStopped(int render_process_id, int lid) {
bool result; bool result;
event_log_manager_->PeerConnectionStopped(render_process_id, lid, event_log_manager_->PeerConnectionStopped(render_process_id, lid,
BoolReplyClosure(&result)); ReplyClosure(&result));
WaitForReply(); WaitForReply();
return result; return result;
} }
...@@ -337,14 +338,14 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> { ...@@ -337,14 +338,14 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> {
size_t max_size_bytes = kWebRtcEventLogManagerUnlimitedFileSize) { size_t max_size_bytes = kWebRtcEventLogManagerUnlimitedFileSize) {
bool result; bool result;
event_log_manager_->EnableLocalLogging(local_logs_base_path, max_size_bytes, event_log_manager_->EnableLocalLogging(local_logs_base_path, max_size_bytes,
BoolReplyClosure(&result)); ReplyClosure(&result));
WaitForReply(); WaitForReply();
return result; return result;
} }
bool DisableLocalLogging() { bool DisableLocalLogging() {
bool result; bool result;
event_log_manager_->DisableLocalLogging(BoolReplyClosure(&result)); event_log_manager_->DisableLocalLogging(ReplyClosure(&result));
WaitForReply(); WaitForReply();
return result; return result;
} }
...@@ -355,14 +356,19 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> { ...@@ -355,14 +356,19 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> {
std::string* error_message_output = nullptr) { std::string* error_message_output = nullptr) {
bool result; bool result;
std::string error_message; std::string error_message;
event_log_manager_->StartRemoteLogging( event_log_manager_->StartRemoteLogging(
render_process_id, peer_connection_id, max_size_bytes, render_process_id, peer_connection_id, max_size_bytes,
BoolAndStringReplyClosure(&result, &error_message)); ReplyClosure(&result, &error_message));
WaitForReply(); WaitForReply();
DCHECK_EQ(result, error_message.empty()); // Error report iff call failed. DCHECK_EQ(result, error_message.empty()); // Error report iff call failed.
if (error_message_output) { if (error_message_output) {
*error_message_output = error_message; *error_message_output = error_message;
} }
return result; return result;
} }
...@@ -378,24 +384,24 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> { ...@@ -378,24 +384,24 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> {
const base::Time& delete_begin, const base::Time& delete_begin,
const base::Time& delete_end) { const base::Time& delete_end) {
event_log_manager_->ClearCacheForBrowserContext( event_log_manager_->ClearCacheForBrowserContext(
browser_context, delete_begin, delete_end, VoidReplyClosure()); browser_context, delete_begin, delete_end, ReplyClosure());
WaitForReply(); WaitForReply();
} }
void SetLocalLogsObserver(WebRtcLocalEventLogsObserver* observer) { void SetLocalLogsObserver(WebRtcLocalEventLogsObserver* observer) {
event_log_manager_->SetLocalLogsObserver(observer, VoidReplyClosure()); event_log_manager_->SetLocalLogsObserver(observer, ReplyClosure());
WaitForReply(); WaitForReply();
} }
void SetRemoteLogsObserver(WebRtcRemoteEventLogsObserver* observer) { void SetRemoteLogsObserver(WebRtcRemoteEventLogsObserver* observer) {
event_log_manager_->SetRemoteLogsObserver(observer, VoidReplyClosure()); event_log_manager_->SetRemoteLogsObserver(observer, ReplyClosure());
WaitForReply(); WaitForReply();
} }
void SetWebRtcEventLogUploaderFactoryForTesting( void SetWebRtcEventLogUploaderFactoryForTesting(
std::unique_ptr<WebRtcEventLogUploader::Factory> factory) { std::unique_ptr<WebRtcEventLogUploader::Factory> factory) {
event_log_manager_->SetWebRtcEventLogUploaderFactoryForTesting( event_log_manager_->SetWebRtcEventLogUploaderFactoryForTesting(
std::move(factory), VoidReplyClosure()); std::move(factory), ReplyClosure());
WaitForReply(); WaitForReply();
} }
...@@ -404,7 +410,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> { ...@@ -404,7 +410,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> {
const std::string& message) { const std::string& message) {
std::pair<bool, bool> result; std::pair<bool, bool> result;
event_log_manager_->OnWebRtcEventLogWrite(render_process_id, lid, message, event_log_manager_->OnWebRtcEventLogWrite(render_process_id, lid, message,
BoolPairReplyClosure(&result)); ReplyClosure(&result));
WaitForReply(); WaitForReply();
return result; return result;
} }
...@@ -414,7 +420,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> { ...@@ -414,7 +420,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> {
ASSERT_TRUE( ASSERT_TRUE(
base::Time::FromLocalExploded(frozen_time_exploded, &frozen_time)); base::Time::FromLocalExploded(frozen_time_exploded, &frozen_time));
frozen_clock_.SetNow(frozen_time); frozen_clock_.SetNow(frozen_time);
event_log_manager_->SetClockForTesting(&frozen_clock_, VoidReplyClosure()); event_log_manager_->SetClockForTesting(&frozen_clock_, ReplyClosure());
WaitForReply(); WaitForReply();
} }
...@@ -438,7 +444,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> { ...@@ -438,7 +444,7 @@ class WebRtcEventLogManagerTestBase : public ::testing::TestWithParam<bool> {
std::unique_ptr<WebRtcEventLogManager::PeerConnectionTrackerProxy> std::unique_ptr<WebRtcEventLogManager::PeerConnectionTrackerProxy>
pc_tracker_proxy) { pc_tracker_proxy) {
event_log_manager_->SetPeerConnectionTrackerProxyForTesting( event_log_manager_->SetPeerConnectionTrackerProxyForTesting(
std::move(pc_tracker_proxy), VoidReplyClosure()); std::move(pc_tracker_proxy), ReplyClosure());
WaitForReply(); WaitForReply();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment