| 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;
|
| +}
|
|
|