From 6666f41ba2d8c91f50546e29de356f2a7d351851 Mon Sep 17 00:00:00 2001 From: Sandboxed API Team Date: Sun, 26 May 2019 08:47:19 -0700 Subject: [PATCH] Fix unnecessary unique_ptr in LogServer. PiperOrigin-RevId: 250050562 Change-Id: I6840e68504c741de1e66489279237f4a4a6bc533 --- sandboxed_api/sandbox2/BUILD.bazel | 1 - sandboxed_api/sandbox2/logserver.cc | 5 ++--- sandboxed_api/sandbox2/logserver.h | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sandboxed_api/sandbox2/BUILD.bazel b/sandboxed_api/sandbox2/BUILD.bazel index c9ced23..ca04114 100644 --- a/sandboxed_api/sandbox2/BUILD.bazel +++ b/sandboxed_api/sandbox2/BUILD.bazel @@ -106,7 +106,6 @@ cc_library( deps = [ ":comms", ":logserver_proto_cc", - "@com_google_absl//absl/memory", "@com_google_glog//:glog", ], ) diff --git a/sandboxed_api/sandbox2/logserver.cc b/sandboxed_api/sandbox2/logserver.cc index 8f2a612..be62b35 100644 --- a/sandboxed_api/sandbox2/logserver.cc +++ b/sandboxed_api/sandbox2/logserver.cc @@ -17,17 +17,16 @@ #include #include -#include "absl/memory/memory.h" #include "sandboxed_api/sandbox2/logserver.pb.h" namespace sandbox2 { -LogServer::LogServer(int fd) : comms_(absl::make_unique(fd)) {} +LogServer::LogServer(int fd) : comms_(fd) {} void LogServer::Run() { namespace logging = ::google; LogMessage msg; - while (comms_->RecvProtoBuf(&msg)) { + while (comms_.RecvProtoBuf(&msg)) { logging::LogSeverity severity = msg.severity(); const char* fatal_string = ""; if (severity == logging::FATAL) { diff --git a/sandboxed_api/sandbox2/logserver.h b/sandboxed_api/sandbox2/logserver.h index e9b26f5..5641bef 100644 --- a/sandboxed_api/sandbox2/logserver.h +++ b/sandboxed_api/sandbox2/logserver.h @@ -15,8 +15,6 @@ #ifndef SANDBOXED_API_SANDBOX2_LOGSERVER_H_ #define SANDBOXED_API_SANDBOX2_LOGSERVER_H_ -#include - #include "sandboxed_api/sandbox2/comms.h" namespace sandbox2 { @@ -34,7 +32,7 @@ class LogServer { void Run(); private: - std::unique_ptr comms_; + Comms comms_; }; } // namespace sandbox2