Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: services/http_server/http_server_impl.cc

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase ontop of master, address trung's comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/http_server/http_server_impl.h ('k') | services/keyboard/linux/keyboard_service_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/http_server/http_server_impl.cc
diff --git a/services/http_server/http_server_impl.cc b/services/http_server/http_server_impl.cc
index fa7f5b34215cfb7dcabf0d53d94a50f24e59e731..c05f39cfa07bc84151ad03faf3516941105f5fb7 100644
--- a/services/http_server/http_server_impl.cc
+++ b/services/http_server/http_server_impl.cc
@@ -4,6 +4,8 @@
#include "services/http_server/http_server_impl.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/logging.h"
#include "mojo/public/cpp/application/application_impl.h"
@@ -33,14 +35,15 @@ void HttpServerImpl::AddBinding(mojo::InterfaceRequest<HttpServer> request) {
}
void HttpServerImpl::SetHandler(const mojo::String& path,
- HttpHandlerPtr http_handler,
+ mojo::InterfaceHandle<HttpHandler> http_handler,
const mojo::Callback<void(bool)>& callback) {
for (const auto& handler : handlers_) {
if (handler->pattern->pattern() == path)
callback.Run(false);
}
- Handler* handler = new Handler(path, http_handler.Pass());
+ Handler* handler =
+ new Handler(path, HttpHandlerPtr::Create(std::move(http_handler)));
handler->http_handler.set_connection_error_handler(
[this, handler]() { OnHandlerConnectionError(handler); });
handlers_.push_back(handler);
« no previous file with comments | « services/http_server/http_server_impl.h ('k') | services/keyboard/linux/keyboard_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698