Index: third_party/grpc/src/python/grpcio/grpc/framework/core/_utilities.py |
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py b/third_party/grpc/src/python/grpcio/grpc/framework/core/_utilities.py |
similarity index 67% |
copy from third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py |
copy to third_party/grpc/src/python/grpcio/grpc/framework/core/_utilities.py |
index 1b02d66267e294ce83977dac64f075981705647c..abedc727e4a84883b318b35f4014538d25522475 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/websocket/close_wsh.py |
+++ b/third_party/grpc/src/python/grpcio/grpc/framework/core/_utilities.py |
@@ -1,4 +1,4 @@ |
-# Copyright 2011, Google Inc. |
+# Copyright 2015, Google Inc. |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
@@ -27,27 +27,28 @@ |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+"""Package-internal utilities.""" |
-import logging |
-_GOODBYE_MESSAGE = u'Goodbye' |
+import collections |
+from grpc.framework.interfaces.base import base |
-def web_socket_do_extra_handshake(request): |
- pass # Always accept. |
+class ServicerPackage( |
+ collections.namedtuple( |
+ 'ServicerPackage', ('servicer', 'default_timeout', 'maximum_timeout'))): |
+ """A trivial bundle class. |
-def web_socket_transfer_data(request): |
- while True: |
- line = request.ws_stream.receive_message() |
- if line is None: |
- return |
- if isinstance(line, unicode): |
- request.ws_stream.send_message(line, binary=False) |
- if line == _GOODBYE_MESSAGE: |
- return |
- else: |
- request.ws_stream.send_message(line, binary=True) |
+ Attributes: |
+ servicer: A base.Servicer. |
+ default_timeout: A float indicating the length of time in seconds to allow |
+ for an operation invoked without a timeout. |
+ maximum_timeout: A float indicating the maximum length of time in seconds to |
+ allow for an operation. |
+ """ |
-def web_socket_passive_closing_handshake(request): |
- return request.ws_close_code, request.ws_close_reason |
+class Outcome( |
+ base.Outcome, |
+ collections.namedtuple('Outcome', ('kind', 'code', 'details',))): |
+ """A trivial implementation of base.Outcome.""" |