mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Fix unnecessary unique_ptr in LogServer.
PiperOrigin-RevId: 250050562 Change-Id: I6840e68504c741de1e66489279237f4a4a6bc533
This commit is contained in:
parent
08ff939ea7
commit
6666f41ba2
|
@ -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",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user