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

Unified Diff: remoting/test/fake_port_allocator.h

Issue 427613005: Implement network performance simulation for remoting perf tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « remoting/test/fake_network_manager.cc ('k') | remoting/test/fake_port_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/fake_port_allocator.h
diff --git a/remoting/test/fake_port_allocator.h b/remoting/test/fake_port_allocator.h
new file mode 100644
index 0000000000000000000000000000000000000000..18fd7bdac9daa33e67e5cf5c8bb4c2b3f3239e05
--- /dev/null
+++ b/remoting/test/fake_port_allocator.h
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_TEST_FAKE_PORT_ALLOCATOR_H_
+#define REMOTING_TEST_FAKE_PORT_ALLOCATOR_H_
+
+#include <set>
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "third_party/libjingle/source/talk/p2p/client/httpportallocator.h"
+
+namespace remoting {
+
+class FakeNetworkDispatcher;
+class FakePacketSocketFactory;
+
+class FakePortAllocator : public cricket::HttpPortAllocatorBase {
+ public:
+ static scoped_ptr<FakePortAllocator> Create(
+ scoped_refptr<FakeNetworkDispatcher> fake_network_dispatcher);
+
+ virtual ~FakePortAllocator();
+
+ FakePacketSocketFactory* socket_factory() { return socket_factory_.get(); }
+
+ // cricket::BasicPortAllocator overrides.
+ virtual cricket::PortAllocatorSession* CreateSessionInternal(
+ const std::string& content_name,
+ int component,
+ const std::string& ice_username_fragment,
+ const std::string& ice_password) OVERRIDE;
+
+ private:
+ FakePortAllocator(scoped_ptr<rtc::NetworkManager> network_manager,
+ scoped_ptr<FakePacketSocketFactory> socket_factory);
+
+ scoped_ptr<rtc::NetworkManager> network_manager_;
+ scoped_ptr<FakePacketSocketFactory> socket_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakePortAllocator);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_TEST_FAKE_PORT_ALLOCATOR_H_
« no previous file with comments | « remoting/test/fake_network_manager.cc ('k') | remoting/test/fake_port_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698