Replace ScopedFd with unique_fd

This will be the new aidl-cpp type used for this purpose going forward.

Bug:  27804373
Change-Id: Ia33dafa467a442742aeace2beffc05751c116b30
Test: Compiles.
diff --git a/libwebserv/binder_request_handler.cc b/libwebserv/binder_request_handler.cc
index 3891135..9dd4325 100644
--- a/libwebserv/binder_request_handler.cc
+++ b/libwebserv/binder_request_handler.cc
@@ -33,7 +33,7 @@
   vector<string> headers;
   vector<string> query_params;
   vector<string> post_params;
-  ScopedFd body;
+  android::base::unique_fd body;
 
   // TODO(b/27407721): Fewer binder calls here
   status = request->GetUrl(&url);
diff --git a/libwebserv/binder_request_impl.cc b/libwebserv/binder_request_impl.cc
index 2a81e29..e93ce27 100644
--- a/libwebserv/binder_request_impl.cc
+++ b/libwebserv/binder_request_impl.cc
@@ -24,7 +24,7 @@
                                      const vector<string>& headers,
                                      const vector<string>& query_params,
                                      const vector<string>& post_params,
-                                     ScopedFd&& body)
+                                     android::base::unique_fd&& body)
     : Request(url, method),
       body_(std::move(body)) {
   CHECK(!(headers.size() % 2));
diff --git a/libwebserv/binder_request_impl.h b/libwebserv/binder_request_impl.h
index f8e2a0f..eae2b78 100644
--- a/libwebserv/binder_request_impl.h
+++ b/libwebserv/binder_request_impl.h
@@ -20,7 +20,7 @@
 
 #include <brillo/streams/file_stream.h>
 
-#include <nativehelper/ScopedFd.h>
+#include <android-base/unique_fd.h>
 
 #include "libwebserv/request.h"
 
@@ -33,12 +33,12 @@
                     const std::vector<std::string>& headers,
                     const std::vector<std::string>& query_params,
                     const std::vector<std::string>& post_params,
-                    ScopedFd&& body);
+                    android::base::unique_fd&& body);
 
   brillo::StreamPtr GetDataStream() override;
 
  private:
-  ScopedFd body_;
+  android::base::unique_fd body_;
 
   DISALLOW_COPY_AND_ASSIGN(BinderRequestImpl);
 };
diff --git a/libwebserv/binder_response.cc b/libwebserv/binder_response.cc
index ddcffab..4f497f8 100644
--- a/libwebserv/binder_response.cc
+++ b/libwebserv/binder_response.cc
@@ -44,7 +44,7 @@
                            const std::string& mime_type) {
   vector<string> headers;
   AddHeader(brillo::http::response_header::kContentType, mime_type);
-  ScopedFd data_out;
+  android::base::unique_fd data_out;
 
   for (const auto& header : headers_) {
     headers.emplace_back(header.first);
diff --git a/webservd/binder_request.cc b/webservd/binder_request.cc
index 96c0a86..4b7d1ea 100644
--- a/webservd/binder_request.cc
+++ b/webservd/binder_request.cc
@@ -33,7 +33,7 @@
 namespace webservd {
 
 namespace {
-Status DupToScopedFd(int fd, ScopedFd* target) {
+Status DupToScopedFd(int fd, android::base::unique_fd* target) {
 
   do {
     target->reset(dup(fd));
@@ -51,7 +51,7 @@
 
 }  // namespace
 
-Status HttpRequest::GetBody(ScopedFd* body) {
+Status HttpRequest::GetBody(android::base::unique_fd* body) {
   return DupToScopedFd(request_->GetBodyDataFileDescriptor(), body);
 }
 
@@ -93,7 +93,7 @@
 Status HttpRequest::Respond(int32_t status_code,
                             const vector<string>& response_headers,
                             int32_t data_size,
-                            ScopedFd* response_stream) {
+                            android::base::unique_fd* response_stream) {
   if (response_headers.size() % 2) {
     return Status::fromExceptionCode(Status::EX_ILLEGAL_ARGUMENT,
         String8("Header array contained unmatched key."));
diff --git a/webservd/binder_request.h b/webservd/binder_request.h
index 1e8e74a..9fe7f28 100644
--- a/webservd/binder_request.h
+++ b/webservd/binder_request.h
@@ -19,7 +19,7 @@
 #include <string>
 #include <vector>
 
-#include <nativehelper/ScopedFd.h>
+#include <android-base/unique_fd.h>
 
 #include "android/webservd/BnHttpRequest.h"
 
@@ -33,7 +33,7 @@
  public:
   explicit HttpRequest(::webservd::Request* request) : request_(request) {}
 
-  android::binder::Status GetBody(ScopedFd* body) override;
+  android::binder::Status GetBody(android::base::unique_fd* body) override;
   android::binder::Status GetUrl(std::string* url) override;
   android::binder::Status GetMethod(std::string* method) override;
   android::binder::Status GetQueryParams(std::vector<std::string>* params)
@@ -46,11 +46,11 @@
       int32_t status_code,
       const std::vector<std::string>& response_headers,
       int32_t data_size,
-      ScopedFd* response_stream) override;
+      android::base::unique_fd* response_stream) override;
 
  private:
   ::webservd::Request* request_;
-  ScopedFd body_;
+  android::base::unique_fd body_;
 
   DISALLOW_COPY_AND_ASSIGN(HttpRequest);
 };