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

Unified Diff: sky/services/ns_net/network_service_impl.h

Issue 1165283002: Basic network service implementation for iOS (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
Index: sky/services/ns_net/network_service_impl.h
diff --git a/sky/services/ns_net/network_service_impl.h b/sky/services/ns_net/network_service_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..3e46333ce01bb961862d8e8c8caa00d1a362a111
--- /dev/null
+++ b/sky/services/ns_net/network_service_impl.h
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/public/cpp/application/interface_factory.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "mojo/services/network/public/interfaces/network_service.mojom.h"
+
+namespace mojo {
+
+class NetworkServiceImpl : public NetworkService {
+ public:
+ explicit NetworkServiceImpl(InterfaceRequest<NetworkService> request)
+ : binding_(this, request.Pass()) {}
+
+ void CreateURLLoader(mojo::InterfaceRequest<mojo::URLLoader> loader) override;
+ void GetCookieStore(
+ mojo::InterfaceRequest<mojo::CookieStore> cookie_store) override;
+ void CreateWebSocket(mojo::InterfaceRequest<mojo::WebSocket> socket) override;
+ void CreateTCPBoundSocket(
+ mojo::NetAddressPtr local_address,
eseidel 2015/06/08 20:53:53 We're in the mojo: namespace, we shouldn't need to
+ mojo::InterfaceRequest<mojo::TCPBoundSocket> bound_socket,
+ const CreateTCPBoundSocketCallback& callback) override;
+ void CreateTCPConnectedSocket(
+ mojo::NetAddressPtr remote_address,
+ mojo::ScopedDataPipeConsumerHandle send_stream,
+ mojo::ScopedDataPipeProducerHandle receive_stream,
+ mojo::InterfaceRequest<mojo::TCPConnectedSocket> client_socket,
+ const CreateTCPConnectedSocketCallback& callback) override;
+ void CreateUDPSocket(mojo::InterfaceRequest<mojo::UDPSocket> socket) override;
+ void CreateHttpServer(mojo::NetAddressPtr local_address,
+ mojo::HttpServerDelegatePtr delegate,
+ const CreateHttpServerCallback& callback) override;
+
+ private:
+ StrongBinding<NetworkService> binding_;
+};
+
+class NetworkServiceFactory : public InterfaceFactory<NetworkService> {
+ public:
+ void Create(ApplicationConnection* connection,
+ InterfaceRequest<NetworkService> request) override;
+};
+
+} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698