webserver: Moved platform2/libwebserv to platform2/webserver
Cleaned up the code structure a bit inside the web server directory
to reflect the current layout of functionality:
- Renamed the top-level director from libwebserv to webserver
- Moved the client library code to sub-directory of libwebserv to
be on the same level as the web server daemon (webservd).
- Updated the source code to reflect the new include paths.
BUG=brillo:10
TEST=FEATURES=test emerge-storm webserver privetd ap-daemons
CQ-DEPEND=CL:245755,CL:*195317
Change-Id: Idb8d665b6e0c15b5ee0219ff72327045a7084363
Reviewed-on: https://chromium-review.googlesource.com/245736
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/libwebserv/request_handler_interface.h b/libwebserv/request_handler_interface.h
new file mode 100644
index 0000000..0b12126
--- /dev/null
+++ b/libwebserv/request_handler_interface.h
@@ -0,0 +1,28 @@
+// Copyright 2014 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBSERVER_LIBWEBSERV_REQUEST_HANDLER_INTERFACE_H_
+#define WEBSERVER_LIBWEBSERV_REQUEST_HANDLER_INTERFACE_H_
+
+#include <base/memory/scoped_ptr.h>
+#include <libwebserv/request.h>
+#include <libwebserv/response.h>
+
+namespace libwebserv {
+
+// The base interface for HTTP request handlers. When registering a handler,
+// the RequestHandlerInterface is provided, and when a request comes in,
+// RequestHandlerInterface::HandleRequest() is called to process the data and
+// send response.
+class RequestHandlerInterface {
+ public:
+ using HandlerSignature = void(scoped_ptr<Request>, scoped_ptr<Response>);
+
+ virtual void HandleRequest(scoped_ptr<Request> request,
+ scoped_ptr<Response> response) = 0;
+};
+
+} // namespace libwebserv
+
+#endif // WEBSERVER_LIBWEBSERV_REQUEST_HANDLER_INTERFACE_H_