Chromium Code Reviews| 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 // This is just a notification and |didClose| will be called then. | |
| 50 virtual void didFail(WebSocketHandle*, const WebString& message) = 0; | |
|
abarth-chromium
2013/10/23 18:26:24
Why have a separate didFail call? It seems strang
yhirano
2013/10/24 00:43:32
DropChannel - didClose is a special message: it re
yhirano
2013/10/31 03:34:50
I changed my mind.
Done.
| |
| 51 | |
| 48 // Called when data are received. | 52 // Called when data are received. |
| 49 virtual void didReceiveData(WebSocketHandle*, bool fin, WebSocketHandle::Mes sageType, const char* data, size_t /* size */) = 0; | 53 virtual void didReceiveData(WebSocketHandle*, bool fin, WebSocketHandle::Mes sageType, const char* data, size_t /* size */) = 0; |
| 50 | 54 |
| 51 // Called when the handle is closed. | 55 // Called when the handle is closed. |
| 52 virtual void didClose(WebSocketHandle*, unsigned short code, const WebString & reason) = 0; | 56 // Deperecated: will be removed soon. |
| 57 virtual void didClose(WebSocketHandle* handle, unsigned short code, const We bString& reason) | |
| 58 { | |
| 59 didClose(handle, false, code, reason); | |
| 60 } | |
| 61 | |
| 62 // Called when the handle is closed. | |
| 63 virtual void didClose(WebSocketHandle*, bool fail, unsigned short code, cons t WebString& reason) = 0; | |
|
tyoshino (SeeGerritForStatus)
2013/10/24 09:08:44
fail -> wasClean?
yhirano
2013/10/24 09:11:35
Thanks, done.
| |
| 53 | 64 |
| 54 virtual void didReceiveFlowControl(WebSocketHandle*, int64_t quota) = 0; | 65 virtual void didReceiveFlowControl(WebSocketHandle*, int64_t quota) = 0; |
| 55 }; | 66 }; |
| 56 | 67 |
| 57 } // namespace WebKit | 68 } // namespace WebKit |
| 58 | 69 |
| 59 #endif // WebSocketHandleClient_h | 70 #endif // WebSocketHandleClient_h |
| OLD | NEW |