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 = [
":comms",
":logserver_proto_cc",
"@com_google_absl//absl/memory",
"@com_google_glog//:glog",
],
)

View File

@ -17,17 +17,16 @@
#include <string>
#include <glog/logging.h>
#include "absl/memory/memory.h"
#include "sandboxed_api/sandbox2/logserver.pb.h"
namespace sandbox2 {
LogServer::LogServer(int fd) : comms_(absl::make_unique<Comms>(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) {

View File

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