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

Unified Diff: third_party/grpc/test/cpp/qps/worker.cc

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/grpc/test/cpp/qps/usage_timer.cc ('k') | third_party/grpc/test/cpp/util/benchmark_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/test/cpp/qps/worker.cc
diff --git a/third_party/WebKit/public/platform/linux/WebFallbackFont.h b/third_party/grpc/test/cpp/qps/worker.cc
similarity index 60%
copy from third_party/WebKit/public/platform/linux/WebFallbackFont.h
copy to third_party/grpc/test/cpp/qps/worker.cc
index 7e3746e91ef3ee06a044bd44307bc473e6ceaa80..f42cfe3255a399c9a67d8b8c56445826b8894962 100644
--- a/third_party/WebKit/public/platform/linux/WebFallbackFont.h
+++ b/third_party/grpc/test/cpp/qps/worker.cc
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Copyright 2015-2016, Google Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -26,32 +28,49 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
*/
-#ifndef WebFallbackFont_h
-#define WebFallbackFont_h
-
-#include "../WebCString.h"
-#include "../WebCommon.h"
-
-namespace blink {
-
-struct WebFallbackFont {
- WebFallbackFont()
- : name(WebCString())
- , filename(WebCString())
- , fontconfigInterfaceId(0)
- , ttcIndex(0)
- , isBold(false)
- , isItalic(false) { }
- WebCString name;
- WebCString filename;
- int fontconfigInterfaceId;
- int ttcIndex;
- bool isBold;
- bool isItalic;
-};
-
-} // namespace blink
-
-#endif // WebFallbackFont_h
+#include <sys/signal.h>
+
+#include <chrono>
+#include <thread>
+
+#include <gflags/gflags.h>
+#include <grpc/grpc.h>
+#include <grpc/support/time.h>
+
+#include "test/cpp/qps/qps_worker.h"
+#include "test/cpp/util/test_config.h"
+
+DEFINE_int32(driver_port, 0, "Port for communication with driver");
+DEFINE_int32(server_port, 0, "Port for operation as a server");
+
+static bool got_sigint = false;
+
+static void sigint_handler(int x) { got_sigint = true; }
+
+namespace grpc {
+namespace testing {
+
+static void RunServer() {
+ QpsWorker worker(FLAGS_driver_port, FLAGS_server_port);
+
+ while (!got_sigint && !worker.Done()) {
+ gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+ gpr_time_from_seconds(5, GPR_TIMESPAN)));
+ }
+}
+
+} // namespace testing
+} // namespace grpc
+
+int main(int argc, char** argv) {
+ grpc::testing::InitTest(&argc, &argv, true);
+
+ signal(SIGINT, sigint_handler);
+
+ grpc::testing::RunServer();
+
+ return 0;
+}
« no previous file with comments | « third_party/grpc/test/cpp/qps/usage_timer.cc ('k') | third_party/grpc/test/cpp/util/benchmark_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698