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

Unified Diff: mojo/services/network/public/cpp/udp_socket_wrapper.h

Issue 880613005: De-Clientize UDPSocket service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rollin
Patch Set: Created 5 years, 11 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: mojo/services/network/public/cpp/udp_socket_wrapper.h
diff --git a/mojo/services/network/public/cpp/udp_socket_wrapper.h b/mojo/services/network/public/cpp/udp_socket_wrapper.h
index 650f98e411cd5d1e21decd658e2188799f8fdf2c..dcadda5060f11cc761108b8de018057acc14d385 100644
--- a/mojo/services/network/public/cpp/udp_socket_wrapper.h
+++ b/mojo/services/network/public/cpp/udp_socket_wrapper.h
@@ -8,6 +8,7 @@
#include <queue>
#include "network/public/interfaces/udp_socket.mojom.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
namespace mojo {
@@ -18,7 +19,7 @@ namespace mojo {
// - You don't need to worry about the max-pending-send-requests restriction
// imposed by the service side. If you make many SendTo() calls in a short
// period of time, it caches excessive requests and sends them later.
-class UDPSocketWrapper : public UDPSocketClient {
+class UDPSocketWrapper : public UDPSocketReceiver {
public:
typedef Callback<void(NetworkErrorPtr, NetAddressPtr, Array<uint8_t>)>
ReceiveCallback;
@@ -116,7 +117,7 @@ class UDPSocketWrapper : public UDPSocketClient {
ErrorCallback callback;
};
- // UDPSocketClient implementation:
+ // UDPSocketReceiver implementation:
void OnReceived(NetworkErrorPtr result,
NetAddressPtr src_addr,
Array<uint8_t> data) override;
@@ -130,6 +131,8 @@ class UDPSocketWrapper : public UDPSocketClient {
// Returns true if a send request in |send_requests_| has been processed.
bool ProcessNextSendRequest();
+ Binding<UDPSocketReceiver> binding_;
+
UDPSocketPtr socket_;
uint32_t max_receive_queue_size_;

Powered by Google App Engine
This is Rietveld 408576698