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

Unified Diff: blimp/test/fake_engine/fake_engine.cc

Issue 2626423004: Remove all //blimp code. (Closed)
Patch Set: One last(?) `git merge` for good measure. Created 3 years, 11 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 | « blimp/test/fake_engine/fake_engine.h ('k') | blimp/test/fake_engine/fake_engine_app_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/test/fake_engine/fake_engine.cc
diff --git a/blimp/test/fake_engine/fake_engine.cc b/blimp/test/fake_engine/fake_engine.cc
deleted file mode 100644
index 18d97df5a6d39d1063e5a83c6534db914d546374..0000000000000000000000000000000000000000
--- a/blimp/test/fake_engine/fake_engine.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2016 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.
-
-#include "blimp/test/fake_engine/fake_engine.h"
-
-#include <fcntl.h>
-
-#include "base/logging.h"
-#include "blimp/test/fake_engine/proto/engine.grpc.pb.h"
-#include "blimp/test/fake_engine/proto/lifetime.grpc.pb.h"
-#include "blimp/test/fake_engine/proto/logging.grpc.pb.h"
-#include "third_party/grpc/include/grpc++/create_channel_posix.h"
-#include "third_party/grpc/include/grpc++/grpc++.h"
-#include "third_party/grpc/include/grpc++/server_posix.h"
-
-namespace blimp {
-
-grpc::Status EngineServiceImpl::CheckHealth(
- grpc::ServerContext* context,
- const CheckHealthRequest* request,
- CheckHealthResponse* response) {
- response->set_status(CheckHealthResponse::OK);
- return grpc::Status::OK;
-}
-
-grpc::Status EngineServiceImpl::ShutDown(
- grpc::ServerContext* context,
- const ShutDownRequest* request,
- ShutDownResponse* response) {
- exit(0);
- return grpc::Status::OK;
-}
-
-FakeEngine::FakeEngine() = default;
-FakeEngine::~FakeEngine() = default;
-
-void FakeEngine::Start() {
- DCHECK(!grpc_server_) << "FakeEngine already started.";
-
- grpc::ServerBuilder builder;
- builder.RegisterService(&engine_service_);
- grpc_server_ = builder.BuildAndStart();
-
- // TODO(xyzzyz): Remove fcntl when https://github.com/grpc/grpc/pull/8051 is
- // merged and added to Chromium.
- int flags = fcntl(kEngineListenFd, F_GETFL, 0);
- CHECK_EQ(0, fcntl(kEngineListenFd, F_SETFL, flags | O_NONBLOCK));
-
- grpc::AddInsecureChannelFromFd(grpc_server_.get(), kEngineListenFd);
- VLOG(1) << "Started engine server.";
-
- rendering_server_channel_ = grpc::CreateInsecureChannelFromFd(
- "rendering_server", kRenderingServerListenFd);
- lifetime_stub_ = Lifetime::NewStub(rendering_server_channel_);
- logging_stub_ = Logging::NewStub(rendering_server_channel_);
-
- EngineReadyRequest request;
- EngineReadyResponse response;
-
- grpc::ClientContext context;
- grpc::Status status = lifetime_stub_->EngineReady(
- &context, request, &response);
-
- CHECK(status.ok()) << "EngineReady RPC failed: "
- << status.error_code() << ": " << status.error_message();
- VLOG(1) << "EngineReady RPC success";
-}
-
-void FakeEngine::WaitForShutdown() {
- DCHECK(grpc_server_) << "FakeEngine not started.";
- grpc_server_->Wait();
-}
-
-Lifetime::Stub* FakeEngine::GetLifetimeStub() {
- return lifetime_stub_.get();
-}
-
-Logging::Stub* FakeEngine::GetLoggingStub() {
- return logging_stub_.get();
-}
-
-} // namespace blimp
« no previous file with comments | « blimp/test/fake_engine/fake_engine.h ('k') | blimp/test/fake_engine/fake_engine_app_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698