http-client-branch: (WebSocket) cleanup http-client-branch
authorprappo
Thu, 23 Nov 2017 18:52:22 +0300
branchhttp-client-branch
changeset 55863 04c2bb7a1693
parent 55862 faa39b5ec8e1
child 55864 ece2f3de738f
http-client-branch: (WebSocket) cleanup
src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/FrameConsumer.java
src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/MessageStreamConsumer.java
src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/FrameConsumer.java	Thu Nov 23 17:46:02 2017 +0300
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/FrameConsumer.java	Thu Nov 23 18:52:22 2017 +0300
@@ -184,7 +184,7 @@
             part = determinePart(isLast);
             boolean text = opcode == Opcode.TEXT || originatingOpcode == Opcode.TEXT;
             if (!text) {
-                output.onBinary(part, data.slice());
+                output.onBinary(data.slice(), part);
                 data.position(data.limit()); // Consume
             } else {
                 boolean binaryNonEmpty = data.hasRemaining();
@@ -199,7 +199,7 @@
                 if (!(binaryNonEmpty && !textData.hasRemaining())) {
                     // If there's a binary data, that result in no text, then we
                     // don't deliver anything
-                    output.onText(part, textData);
+                    output.onText(textData, part);
                 }
             }
         }
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/MessageStreamConsumer.java	Thu Nov 23 17:46:02 2017 +0300
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/MessageStreamConsumer.java	Thu Nov 23 18:52:22 2017 +0300
@@ -34,9 +34,9 @@
  */
 interface MessageStreamConsumer {
 
-    void onText(MessagePart part, CharSequence data);
+    void onText(CharSequence data, MessagePart part);
 
-    void onBinary(MessagePart part, ByteBuffer data);
+    void onBinary(ByteBuffer data, MessagePart part);
 
     void onPing(ByteBuffer data);
 
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java	Thu Nov 23 17:46:02 2017 +0300
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java	Thu Nov 23 18:52:22 2017 +0300
@@ -455,7 +455,7 @@
         return new MessageStreamConsumer() {
 
             @Override
-            public void onText(MessagePart part, CharSequence data) {
+            public void onText(CharSequence data, MessagePart part) {
                 receiver.acknowledge();
                 synchronized (WebSocketImpl.this.lock) {
                     try {
@@ -467,7 +467,7 @@
             }
 
             @Override
-            public void onBinary(MessagePart part, ByteBuffer data) {
+            public void onBinary(ByteBuffer data, MessagePart part) {
                 receiver.acknowledge();
                 synchronized (WebSocketImpl.this.lock) {
                     try {