Index: third_party/grpc/src/core/iomgr/tcp_posix.h |
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIInput.h b/third_party/grpc/src/core/iomgr/tcp_posix.h |
similarity index 54% |
copy from third_party/WebKit/Source/modules/webmidi/MIDIInput.h |
copy to third_party/grpc/src/core/iomgr/tcp_posix.h |
index 4a74d60ba235755f26a49273ef7d4e20dd7d6c3c..2a40cdd38590b20f75464b4e3822949994ffa75e 100644 |
--- a/third_party/WebKit/Source/modules/webmidi/MIDIInput.h |
+++ b/third_party/grpc/src/core/iomgr/tcp_posix.h |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (C) 2013 Google Inc. All rights reserved. |
+ * |
+ * Copyright 2015-2016, Google Inc. |
+ * All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -26,43 +28,44 @@ |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+ * |
*/ |
-#ifndef MIDIInput_h |
-#define MIDIInput_h |
- |
-#include "modules/EventTargetModules.h" |
-#include "modules/webmidi/MIDIAccessor.h" |
-#include "modules/webmidi/MIDIPort.h" |
- |
-namespace blink { |
- |
-class MIDIAccess; |
+#ifndef GRPC_INTERNAL_CORE_IOMGR_TCP_POSIX_H |
+#define GRPC_INTERNAL_CORE_IOMGR_TCP_POSIX_H |
+/* |
+ Low level TCP "bottom half" implementation, for use by transports built on |
+ top of a TCP connection. |
-class MIDIInput final : public MIDIPort { |
- DEFINE_WRAPPERTYPEINFO(); |
-public: |
- static MIDIInput* create(MIDIAccess*, const String& id, const String& manufacturer, const String& name, const String& version, MIDIAccessor::MIDIPortState); |
- ~MIDIInput() override { } |
+ Note that this file does not (yet) include APIs for creating the socket in |
+ the first place. |
- EventListener* onmidimessage(); |
- void setOnmidimessage(EventListener*); |
+ All calls passing slice transfer ownership of a slice refcount unless |
+ otherwise specified. |
+*/ |
- // EventTarget |
- const AtomicString& interfaceName() const override { return EventTargetNames::MIDIInput; } |
+#include "src/core/iomgr/endpoint.h" |
+#include "src/core/iomgr/fd_posix.h" |
- // |timeStamp| is a DOMHighResTimeStamp in the time coordinate system of performance.now(). |
- void didReceiveMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStamp); |
+#define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192 |
- DECLARE_VIRTUAL_TRACE(); |
+extern int grpc_tcp_trace; |
-protected: |
- bool addEventListenerInternal(const AtomicString& eventType, EventListener*, const EventListenerOptions&) override; |
+/* Create a tcp endpoint given a file desciptor and a read slice size. |
+ Takes ownership of fd. */ |
+grpc_endpoint *grpc_tcp_create(grpc_fd *fd, size_t read_slice_size, |
+ const char *peer_string); |
-private: |
- MIDIInput(MIDIAccess*, const String& id, const String& manufacturer, const String& name, const String& version, MIDIAccessor::MIDIPortState); |
-}; |
+/* Return the tcp endpoint's fd, or -1 if this is not available. Does not |
+ release the fd. |
+ Requires: ep must be a tcp endpoint. |
+ */ |
+int grpc_tcp_fd(grpc_endpoint *ep); |
-} // namespace blink |
+/* Destroy the tcp endpoint without closing its fd. *fd will be set and done |
+ * will be called when the endpoint is destroyed. |
+ * Requires: ep must be a tcp endpoint and fd must not be NULL. */ |
+void grpc_tcp_destroy_and_release_fd(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, |
+ int *fd, grpc_closure *done); |
-#endif // MIDIInput_h |
+#endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_POSIX_H */ |