| Index: mojo/services/network/http_server_apptest.cc
|
| diff --git a/mojo/services/network/http_server_apptest.cc b/mojo/services/network/http_server_apptest.cc
|
| index c9f3a133f4b76a9cb233b09c8f5780ecf730dda3..841e44fc7265727406b1ff2c9b131dd045841f21 100644
|
| --- a/mojo/services/network/http_server_apptest.cc
|
| +++ b/mojo/services/network/http_server_apptest.cc
|
| @@ -10,7 +10,7 @@
|
| #include "base/run_loop.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/stringprintf.h"
|
| -#include "mojo/common/data_pipe_utils.h"
|
| +#include "mojo/data_pipe_utils/data_pipe_utils.h"
|
| #include "mojo/services/network/interfaces/http_connection.mojom.h"
|
| #include "mojo/services/network/interfaces/http_message.mojom.h"
|
| #include "mojo/services/network/interfaces/http_server.mojom.h"
|
| @@ -272,7 +272,7 @@ class TestHttpClient {
|
| class WebSocketClientImpl : public WebSocketClient {
|
| public:
|
| explicit WebSocketClientImpl()
|
| - : binding_(this, &client_ptr_),
|
| + : binding_(this, &client_handle_),
|
| wait_for_message_count_(0),
|
| run_loop_(nullptr) {}
|
| ~WebSocketClientImpl() override {}
|
| @@ -286,7 +286,8 @@ class WebSocketClientImpl : public WebSocketClient {
|
| write_send_stream_.reset(new WebSocketWriteQueue(send_stream_.get()));
|
|
|
| web_socket_->Connect(url, Array<String>(0), "http://example.com",
|
| - data_pipe.consumer_handle.Pass(), client_ptr_.Pass());
|
| + data_pipe.consumer_handle.Pass(),
|
| + client_handle_.Pass());
|
| }
|
|
|
| // Establishes a connection from the server side.
|
| @@ -300,7 +301,7 @@ class WebSocketClientImpl : public WebSocketClient {
|
| write_send_stream_.reset(new WebSocketWriteQueue(send_stream_.get()));
|
|
|
| callback.Run(web_socket_request.Pass(), data_pipe.consumer_handle.Pass(),
|
| - client_ptr_.Pass());
|
| + client_handle_.Pass());
|
| }
|
|
|
| void WaitForConnectCompletion() {
|
| @@ -385,7 +386,7 @@ class WebSocketClientImpl : public WebSocketClient {
|
| }
|
| }
|
|
|
| - WebSocketClientPtr client_ptr_;
|
| + InterfaceHandle<WebSocketClient> client_handle_;
|
| Binding<WebSocketClient> binding_;
|
| WebSocketPtr web_socket_;
|
|
|
| @@ -411,9 +412,9 @@ class HttpConnectionDelegateImpl : public HttpConnectionDelegate {
|
| OnReceivedRequestCallback callback;
|
| };
|
|
|
| - HttpConnectionDelegateImpl(HttpConnectionPtr connection,
|
| + HttpConnectionDelegateImpl(InterfaceHandle<HttpConnection> connection,
|
| InterfaceRequest<HttpConnectionDelegate> request)
|
| - : connection_(connection.Pass()),
|
| + : connection_(HttpConnectionPtr::Create(connection.Pass())),
|
| binding_(this, request.Pass()),
|
| wait_for_request_count_(0),
|
| run_loop_(nullptr) {}
|
| @@ -496,14 +497,15 @@ class HttpConnectionDelegateImpl : public HttpConnectionDelegate {
|
|
|
| class HttpServerDelegateImpl : public HttpServerDelegate {
|
| public:
|
| - explicit HttpServerDelegateImpl(HttpServerDelegatePtr* delegate_ptr)
|
| - : binding_(this, delegate_ptr),
|
| + explicit HttpServerDelegateImpl(
|
| + InterfaceHandle<HttpServerDelegate>* delegate_handle)
|
| + : binding_(this, delegate_handle),
|
| wait_for_connection_count_(0),
|
| run_loop_(nullptr) {}
|
| ~HttpServerDelegateImpl() override {}
|
|
|
| // HttpServerDelegate implementation.
|
| - void OnConnected(HttpConnectionPtr connection,
|
| + void OnConnected(InterfaceHandle<HttpConnection> connection,
|
| InterfaceRequest<HttpConnectionDelegate> delegate) override {
|
| connections_.push_back(make_linked_ptr(
|
| new HttpConnectionDelegateImpl(connection.Pass(), delegate.Pass())));
|
| @@ -556,7 +558,7 @@ class HttpServerAppTest : public test::ApplicationTestBase {
|
| connection->ConnectToService(&network_service_);
|
| }
|
|
|
| - void CreateHttpServer(HttpServerDelegatePtr delegate,
|
| + void CreateHttpServer(InterfaceHandle<HttpServerDelegate> delegate,
|
| NetAddressPtr* out_bound_to) {
|
| network_service_->CreateHttpServer(
|
| GetLocalHostWithAnyPort(), delegate.Pass(),
|
| @@ -580,9 +582,9 @@ class HttpServerAppTest : public test::ApplicationTestBase {
|
|
|
| TEST_F(HttpServerAppTest, BasicHttpRequestResponse) {
|
| NetAddressPtr bound_to;
|
| - HttpServerDelegatePtr server_delegate_ptr;
|
| - HttpServerDelegateImpl server_delegate_impl(&server_delegate_ptr);
|
| - CreateHttpServer(server_delegate_ptr.Pass(), &bound_to);
|
| + InterfaceHandle<HttpServerDelegate> server_delegate_handle;
|
| + HttpServerDelegateImpl server_delegate_impl(&server_delegate_handle);
|
| + CreateHttpServer(server_delegate_handle.Pass(), &bound_to);
|
|
|
| TestHttpClient client;
|
| client.Connect(bound_to.To<net::IPEndPoint>());
|
| @@ -612,9 +614,9 @@ TEST_F(HttpServerAppTest, BasicHttpRequestResponse) {
|
|
|
| TEST_F(HttpServerAppTest, HttpRequestResponseWithBody) {
|
| NetAddressPtr bound_to;
|
| - HttpServerDelegatePtr server_delegate_ptr;
|
| - HttpServerDelegateImpl server_delegate_impl(&server_delegate_ptr);
|
| - CreateHttpServer(server_delegate_ptr.Pass(), &bound_to);
|
| + InterfaceHandle<HttpServerDelegate> server_delegate_handle;
|
| + HttpServerDelegateImpl server_delegate_impl(&server_delegate_handle);
|
| + CreateHttpServer(server_delegate_handle.Pass(), &bound_to);
|
|
|
| TestHttpClient client;
|
| client.Connect(bound_to.To<net::IPEndPoint>());
|
| @@ -650,9 +652,9 @@ TEST_F(HttpServerAppTest, HttpRequestResponseWithBody) {
|
|
|
| TEST_F(HttpServerAppTest, WebSocket) {
|
| NetAddressPtr bound_to;
|
| - HttpServerDelegatePtr server_delegate_ptr;
|
| - HttpServerDelegateImpl server_delegate_impl(&server_delegate_ptr);
|
| - CreateHttpServer(server_delegate_ptr.Pass(), &bound_to);
|
| + InterfaceHandle<HttpServerDelegate> server_delegate_handle;
|
| + HttpServerDelegateImpl server_delegate_impl(&server_delegate_handle);
|
| + CreateHttpServer(server_delegate_handle.Pass(), &bound_to);
|
|
|
| WebSocketPtr web_socket_ptr;
|
| network_service_->CreateWebSocket(GetProxy(&web_socket_ptr));
|
|
|