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

Unified Diff: ipc/ipc_perftest_support.h

Issue 536213002: Add ipc_mojo_perftests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed garbage Created 6 years, 3 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 | « ipc/ipc_channel_factory.h ('k') | ipc/ipc_perftest_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_perftest_support.h
diff --git a/ipc/ipc_perftest_support.h b/ipc/ipc_perftest_support.h
new file mode 100644
index 0000000000000000000000000000000000000000..611a2096330557efa7310721589393b0ede39210
--- /dev/null
+++ b/ipc/ipc_perftest_support.h
@@ -0,0 +1,59 @@
+// Copyright (c) 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 IPC_IPC_PERFTEST_SUPPORT_H_
+#define IPC_IPC_PERFTEST_SUPPORT_H_
+
+#include <vector>
+
+#include "ipc/ipc_test_base.h"
+
+namespace IPC {
+namespace test {
+
+class ChannelReflectorListener;
+
+class PingPongTestParams {
+ public:
+ PingPongTestParams(size_t size, int count)
+ : message_size_(size), message_count_(count) {
+ }
+
+ size_t message_size() const { return message_size_; }
+ int message_count() const { return message_count_; }
+
+ private:
+ size_t message_size_;
+ int message_count_;
+};
+
+class IPCChannelPerfTestBase : public IPCTestBase {
+ public:
+ static std::vector<PingPongTestParams> GetDefaultTestParams();
+
+ void RunTestChannelPingPong(
+ const std::vector<PingPongTestParams>& params_list);
+ void RunTestChannelProxyPingPong(
+ const std::vector<PingPongTestParams>& params_list);
+};
+
+class PingPongTestClient {
+ public:
+ PingPongTestClient();
+ virtual ~PingPongTestClient();
+
+ virtual scoped_ptr<Channel> CreateChannel(Listener* listener);
+ int RunMain();
+ scoped_refptr<base::TaskRunner> task_runner();
+
+ private:
+ base::MessageLoopForIO main_message_loop_;
+ scoped_ptr<ChannelReflectorListener> listener_;
+ scoped_ptr<Channel> channel_;
+};
+
+}
+}
+
+#endif // IPC_IPC_PERFTEST_SUPPORT_H_
« no previous file with comments | « ipc/ipc_channel_factory.h ('k') | ipc/ipc_perftest_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698