Fix unnecessary unique_ptr in LogServer.

PiperOrigin-RevId: 250050562
Change-Id: I6840e68504c741de1e66489279237f4a4a6bc533
This commit is contained in:
Sandboxed API Team 2019-05-26 08:47:19 -07:00 committed by Copybara-Service
parent 08ff939ea7
commit 6666f41ba2
3 changed files with 3 additions and 7 deletions

View File

@ -106,7 +106,6 @@ cc_library(
deps = [ deps = [
":comms", ":comms",
":logserver_proto_cc", ":logserver_proto_cc",
"@com_google_absl//absl/memory",
"@com_google_glog//:glog", "@com_google_glog//:glog",
], ],
) )

View File

@ -17,17 +17,16 @@
#include <string> #include <string>
#include <glog/logging.h> #include <glog/logging.h>
#include "absl/memory/memory.h"
#include "sandboxed_api/sandbox2/logserver.pb.h" #include "sandboxed_api/sandbox2/logserver.pb.h"
namespace sandbox2 { namespace sandbox2 {
LogServer::LogServer(int fd) : comms_(absl::make_unique<Comms>(fd)) {} LogServer::LogServer(int fd) : comms_(fd) {}
void LogServer::Run() { void LogServer::Run() {
namespace logging = ::google; namespace logging = ::google;
LogMessage msg; LogMessage msg;
while (comms_->RecvProtoBuf(&msg)) { while (comms_.RecvProtoBuf(&msg)) {
logging::LogSeverity severity = msg.severity(); logging::LogSeverity severity = msg.severity();
const char* fatal_string = ""; const char* fatal_string = "";
if (severity == logging::FATAL) { if (severity == logging::FATAL) {

View File

@ -15,8 +15,6 @@
#ifndef SANDBOXED_API_SANDBOX2_LOGSERVER_H_ #ifndef SANDBOXED_API_SANDBOX2_LOGSERVER_H_
#define SANDBOXED_API_SANDBOX2_LOGSERVER_H_ #define SANDBOXED_API_SANDBOX2_LOGSERVER_H_
#include <memory>
#include "sandboxed_api/sandbox2/comms.h" #include "sandboxed_api/sandbox2/comms.h"
namespace sandbox2 { namespace sandbox2 {
@ -34,7 +32,7 @@ class LogServer {
void Run(); void Run();
private: private:
std::unique_ptr<Comms> comms_; Comms comms_;
}; };
} // namespace sandbox2 } // namespace sandbox2