Remove functions to inject a TaskQueue in RtcEventLog creation.
The event log implementation will be simpler if it creates its own TaskQueue. If we really need the "injectable" functionality, it could be achieved via a TaskQueueFactory that returns a move-constructible TaskQueue. Bug: webrtc:10085 Change-Id: I538be3dd77c09be2f5bae015227067acd6af8355 Reviewed-on: https://webrtc-review.googlesource.com/c/113140 Reviewed-by: Elad Alon <eladalon@webrtc.org> Commit-Queue: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25908}
This commit is contained in:
parent
b438b5a33d
commit
bd2cf71865
@ -22,12 +22,4 @@ std::unique_ptr<RtcEventLog> FakeRtcEventLogFactory::CreateRtcEventLog(
|
||||
return fake_event_log;
|
||||
}
|
||||
|
||||
std::unique_ptr<RtcEventLog> FakeRtcEventLogFactory::CreateRtcEventLog(
|
||||
RtcEventLog::EncodingType encoding_type,
|
||||
std::unique_ptr<rtc::TaskQueue> task_queue) {
|
||||
std::unique_ptr<RtcEventLog> fake_event_log(new FakeRtcEventLog(thread()));
|
||||
last_log_created_ = fake_event_log.get();
|
||||
return fake_event_log;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -27,10 +27,6 @@ class FakeRtcEventLogFactory : public RtcEventLogFactoryInterface {
|
||||
std::unique_ptr<RtcEventLog> CreateRtcEventLog(
|
||||
RtcEventLog::EncodingType encoding_type) override;
|
||||
|
||||
std::unique_ptr<RtcEventLog> CreateRtcEventLog(
|
||||
RtcEventLog::EncodingType encoding_type,
|
||||
std::unique_ptr<rtc::TaskQueue> task_queue) override;
|
||||
|
||||
webrtc::RtcEventLog* last_log_created() { return last_log_created_; }
|
||||
rtc::Thread* thread() { return thread_; }
|
||||
|
||||
|
||||
@ -37,12 +37,6 @@ class RtcEventLog {
|
||||
// Factory method to create an RtcEventLog object.
|
||||
static std::unique_ptr<RtcEventLog> Create(EncodingType encoding_type);
|
||||
|
||||
// Factory method to create an RtcEventLog object which uses the given
|
||||
// rtc::TaskQueue for emitting output.
|
||||
static std::unique_ptr<RtcEventLog> Create(
|
||||
EncodingType encoding_type,
|
||||
std::unique_ptr<rtc::TaskQueue> task_queue);
|
||||
|
||||
// Create an RtcEventLog object that does nothing.
|
||||
static std::unique_ptr<RtcEventLog> CreateNull();
|
||||
|
||||
|
||||
@ -21,12 +21,6 @@ std::unique_ptr<RtcEventLog> RtcEventLogFactory::CreateRtcEventLog(
|
||||
return RtcEventLog::Create(encoding_type);
|
||||
}
|
||||
|
||||
std::unique_ptr<RtcEventLog> RtcEventLogFactory::CreateRtcEventLog(
|
||||
RtcEventLog::EncodingType encoding_type,
|
||||
std::unique_ptr<rtc::TaskQueue> task_queue) {
|
||||
return RtcEventLog::Create(encoding_type, std::move(task_queue));
|
||||
}
|
||||
|
||||
std::unique_ptr<RtcEventLogFactoryInterface> CreateRtcEventLogFactory() {
|
||||
return std::unique_ptr<RtcEventLogFactoryInterface>(new RtcEventLogFactory());
|
||||
}
|
||||
|
||||
@ -25,10 +25,6 @@ class RtcEventLogFactory : public RtcEventLogFactoryInterface {
|
||||
|
||||
std::unique_ptr<RtcEventLog> CreateRtcEventLog(
|
||||
RtcEventLog::EncodingType encoding_type) override;
|
||||
|
||||
std::unique_ptr<RtcEventLog> CreateRtcEventLog(
|
||||
RtcEventLog::EncodingType encoding_type,
|
||||
std::unique_ptr<rtc::TaskQueue> task_queue) override;
|
||||
};
|
||||
|
||||
std::unique_ptr<RtcEventLogFactoryInterface> CreateRtcEventLogFactory();
|
||||
|
||||
@ -27,10 +27,6 @@ class RtcEventLogFactoryInterface {
|
||||
|
||||
virtual std::unique_ptr<RtcEventLog> CreateRtcEventLog(
|
||||
RtcEventLog::EncodingType encoding_type) = 0;
|
||||
|
||||
virtual std::unique_ptr<RtcEventLog> CreateRtcEventLog(
|
||||
RtcEventLog::EncodingType encoding_type,
|
||||
std::unique_ptr<rtc::TaskQueue> task_queue) = 0;
|
||||
};
|
||||
|
||||
std::unique_ptr<RtcEventLogFactoryInterface> CreateRtcEventLogFactory();
|
||||
|
||||
@ -369,16 +369,10 @@ void RtcEventLogImpl::WriteToOutput(const std::string& output_string) {
|
||||
|
||||
// RtcEventLog member functions.
|
||||
std::unique_ptr<RtcEventLog> RtcEventLog::Create(EncodingType encoding_type) {
|
||||
return Create(encoding_type,
|
||||
absl::make_unique<rtc::TaskQueue>("rtc_event_log"));
|
||||
}
|
||||
|
||||
std::unique_ptr<RtcEventLog> RtcEventLog::Create(
|
||||
EncodingType encoding_type,
|
||||
std::unique_ptr<rtc::TaskQueue> task_queue) {
|
||||
#ifdef ENABLE_RTC_EVENT_LOG
|
||||
return absl::make_unique<RtcEventLogImpl>(CreateEncoder(encoding_type),
|
||||
std::move(task_queue));
|
||||
return absl::make_unique<RtcEventLogImpl>(
|
||||
CreateEncoder(encoding_type),
|
||||
absl::make_unique<rtc::TaskQueue>("rtc_event_log"));
|
||||
#else
|
||||
return CreateNull();
|
||||
#endif // ENABLE_RTC_EVENT_LOG
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user