Revert "Cleanup in NetworkEmulationManagerImpl."

This reverts commit aa274d028710cb9d8f1fe3fe5ff68fe7b04e4cf2.

Reason for revert: Depends on reverted CL.

Original change's description:
> Cleanup in NetworkEmulationManagerImpl.
> 
> Bug: webrtc:9883
> Change-Id: I845ecd66ceda9eb8c144e4c10ff374c050413a04
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133344
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27664}

TBR=srte@webrtc.org,titovartem@webrtc.org

Change-Id: Ib62f19e382ee0a43f5892fcc694395adb410c36f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9883
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133484
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27673}
This commit is contained in:
Sebastian Jansson
2019-04-17 15:56:45 +00:00
committed by Commit Bot
parent 28de7cfd64
commit 011d3a125e
2 changed files with 9 additions and 4 deletions

View File

@ -58,10 +58,13 @@ EmulatedNetworkNode* NetworkEmulationManagerImpl::CreateEmulatedNode(
auto node = absl::make_unique<EmulatedNetworkNode>( auto node = absl::make_unique<EmulatedNetworkNode>(
clock_, &task_queue_, std::move(network_behavior)); clock_, &task_queue_, std::move(network_behavior));
EmulatedNetworkNode* out = node.get(); EmulatedNetworkNode* out = node.get();
task_queue_.PostTask(CreateResourceOwningTask(
std::move(node), [this](std::unique_ptr<EmulatedNetworkNode> node) { struct Closure {
network_nodes_.push_back(std::move(node)); void operator()() { manager->network_nodes_.push_back(std::move(node)); }
})); NetworkEmulationManagerImpl* manager;
std::unique_ptr<EmulatedNetworkNode> node;
};
task_queue_.PostTask(Closure{this, std::move(node)});
return out; return out;
} }

View File

@ -66,6 +66,8 @@ class NetworkEmulationManagerImpl : public NetworkEmulationManager {
const std::vector<EmulatedEndpoint*>& endpoints) override; const std::vector<EmulatedEndpoint*>& endpoints) override;
private: private:
FakeNetworkSocketServer* CreateSocketServer(
const std::vector<EmulatedEndpoint*>& endpoints);
absl::optional<rtc::IPAddress> GetNextIPv4Address(); absl::optional<rtc::IPAddress> GetNextIPv4Address();
void ProcessNetworkPackets(); void ProcessNetworkPackets();
Timestamp Now() const; Timestamp Now() const;