OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 class WebString; | 39 class WebString; |
40 class WebURL; | 40 class WebURL; |
41 | 41 |
42 // FIXME: This class should replace WebSocketStreamHandleClient. | 42 // FIXME: This class should replace WebSocketStreamHandleClient. |
43 class WebSocketHandleClient { | 43 class WebSocketHandleClient { |
44 public: | 44 public: |
45 // Called when the handle is opened. | 45 // Called when the handle is opened. |
46 virtual void didConnect(WebSocketHandle*, bool fail, const WebString& select
edProtocol, const WebString& extensions) = 0; | 46 virtual void didConnect(WebSocketHandle*, bool fail, const WebString& select
edProtocol, const WebString& extensions) = 0; |
47 | 47 |
| 48 // Called when the browser is required to fail the connection. |
| 49 // When this notification arrives the channel is closed as if |
| 50 // didClose(false, 1006, "") arrived. |
| 51 virtual void didFail(WebSocketHandle*, const WebString& message) = 0; |
| 52 |
48 // Called when data are received. | 53 // Called when data are received. |
49 virtual void didReceiveData(WebSocketHandle*, bool fin, WebSocketHandle::Mes
sageType, const char* data, size_t /* size */) = 0; | 54 virtual void didReceiveData(WebSocketHandle*, bool fin, WebSocketHandle::Mes
sageType, const char* data, size_t /* size */) = 0; |
50 | 55 |
51 // Called when the handle is closed. | 56 // Called when the handle is closed. |
52 virtual void didClose(WebSocketHandle*, unsigned short code, const WebString
& reason) = 0; | 57 // Deperecated: will be removed soon. |
| 58 virtual void didClose(WebSocketHandle* handle, unsigned short code, const We
bString& reason) |
| 59 { |
| 60 didClose(handle, false, code, reason); |
| 61 } |
| 62 |
| 63 // Called when the handle is closed. |
| 64 virtual void didClose(WebSocketHandle*, bool wasClean, unsigned short code,
const WebString& reason) = 0; |
53 | 65 |
54 virtual void didReceiveFlowControl(WebSocketHandle*, int64_t quota) = 0; | 66 virtual void didReceiveFlowControl(WebSocketHandle*, int64_t quota) = 0; |
55 }; | 67 }; |
56 | 68 |
57 } // namespace WebKit | 69 } // namespace WebKit |
58 | 70 |
59 #endif // WebSocketHandleClient_h | 71 #endif // WebSocketHandleClient_h |
OLD | NEW |