| Index: third_party/grpc/src/python/grpcio/grpc/framework/base/null.py
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/echo_wsh.py b/third_party/grpc/src/python/grpcio/grpc/framework/base/null.py
|
| similarity index 71%
|
| copy from third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/echo_wsh.py
|
| copy to third_party/grpc/src/python/grpcio/grpc/framework/base/null.py
|
| index 429f58186e3fce43dc21e81e0f9d7e20c7e0bf70..1e30d4557b1f4608537f89ff809a2e66d7b2d73e 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/echo_wsh.py
|
| +++ b/third_party/grpc/src/python/grpcio/grpc/framework/base/null.py
|
| @@ -1,4 +1,4 @@
|
| -# Copyright 2010, Google Inc.
|
| +# Copyright 2015, Google Inc.
|
| # All rights reserved.
|
| #
|
| # Redistribution and use in source and binary forms, with or without
|
| @@ -27,20 +27,30 @@
|
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| +"""Null links that ignore tickets passed to them."""
|
|
|
| -from mod_pywebsocket import msgutil
|
| +from grpc.framework.base import interfaces
|
|
|
|
|
| -_GOODBYE_MESSAGE = 'Goodbye'
|
| +class _NullForeLink(interfaces.ForeLink):
|
| + """A do-nothing ForeLink."""
|
|
|
| + def accept_back_to_front_ticket(self, ticket):
|
| + pass
|
|
|
| -def web_socket_do_extra_handshake(request):
|
| - pass # Always accept.
|
| + def join_rear_link(self, rear_link):
|
| + raise NotImplementedError()
|
|
|
|
|
| -def web_socket_transfer_data(request):
|
| - while True:
|
| - line = msgutil.receive_message(request)
|
| - msgutil.send_message(request, line)
|
| - if line == _GOODBYE_MESSAGE:
|
| - return
|
| +class _NullRearLink(interfaces.RearLink):
|
| + """A do-nothing RearLink."""
|
| +
|
| + def accept_front_to_back_ticket(self, ticket):
|
| + pass
|
| +
|
| + def join_fore_link(self, fore_link):
|
| + raise NotImplementedError()
|
| +
|
| +
|
| +NULL_FORE_LINK = _NullForeLink()
|
| +NULL_REAR_LINK = _NullRearLink()
|
|
|