Revert "Replace ScopedFd with unique_fd"

This reverts commit 2e27eff7622d8fd96ab20555821eb9c642058eb9.

Change-Id: I643b7fa7a782a6b52ef0de64c04da6869e5d8907
diff --git a/libwebserv/binder_request_handler.cc b/libwebserv/binder_request_handler.cc
index 9dd4325..3891135 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;
-  android::base::unique_fd body;
+  ScopedFd 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 e93ce27..2a81e29 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,
-                                     android::base::unique_fd&& body)
+                                     ScopedFd&& 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 eae2b78..f8e2a0f 100644
--- a/libwebserv/binder_request_impl.h
+++ b/libwebserv/binder_request_impl.h
@@ -20,7 +20,7 @@
 
 #include <brillo/streams/file_stream.h>
 
-#include <android-base/unique_fd.h>
+#include <nativehelper/ScopedFd.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,
-                    android::base::unique_fd&& body);
+                    ScopedFd&& body);
 
   brillo::StreamPtr GetDataStream() override;
 
  private:
-  android::base::unique_fd body_;
+  ScopedFd body_;
 
   DISALLOW_COPY_AND_ASSIGN(BinderRequestImpl);
 };
diff --git a/libwebserv/binder_response.cc b/libwebserv/binder_response.cc
index 4f497f8..ddcffab 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);
-  android::base::unique_fd data_out;
+  ScopedFd 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 4b7d1ea..96c0a86 100644
--- a/webservd/binder_request.cc
+++ b/webservd/binder_request.cc
@@ -33,7 +33,7 @@
 namespace webservd {
 
 namespace {
-Status DupToScopedFd(int fd, android::base::unique_fd* target) {
+Status DupToScopedFd(int fd, ScopedFd* target) {
 
   do {
     target->reset(dup(fd));
@@ -51,7 +51,7 @@
 
 }  // namespace
 
-Status HttpRequest::GetBody(android::base::unique_fd* body) {
+Status HttpRequest::GetBody(ScopedFd* 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,
-                            android::base::unique_fd* response_stream) {
+                            ScopedFd* 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 9fe7f28..1e8e74a 100644
--- a/webservd/binder_request.h
+++ b/webservd/binder_request.h
@@ -19,7 +19,7 @@
 #include <string>
 #include <vector>
 
-#include <android-base/unique_fd.h>
+#include <nativehelper/ScopedFd.h>
 
 #include "android/webservd/BnHttpRequest.h"
 
@@ -33,7 +33,7 @@
  public:
   explicit HttpRequest(::webservd::Request* request) : request_(request) {}
 
-  android::binder::Status GetBody(android::base::unique_fd* body) override;
+  android::binder::Status GetBody(ScopedFd* 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,
-      android::base::unique_fd* response_stream) override;
+      ScopedFd* response_stream) override;
 
  private:
   ::webservd::Request* request_;
-  android::base::unique_fd body_;
+  ScopedFd body_;
 
   DISALLOW_COPY_AND_ASSIGN(HttpRequest);
 };