| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 CloseEventCodeMinimumUserDefined = 3000, | 71 CloseEventCodeMinimumUserDefined = 3000, |
| 72 CloseEventCodeMaximumUserDefined = 4999 | 72 CloseEventCodeMaximumUserDefined = 4999 |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 virtual bool connect(const KURL&, const String& protocol) = 0; | 75 virtual bool connect(const KURL&, const String& protocol) = 0; |
| 76 virtual void send(const String& message) = 0; | 76 virtual void send(const String& message) = 0; |
| 77 virtual void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteL
ength) = 0; | 77 virtual void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteL
ength) = 0; |
| 78 virtual void send(PassRefPtr<BlobDataHandle>) = 0; | 78 virtual void send(PassRefPtr<BlobDataHandle>) = 0; |
| 79 | 79 |
| 80 // For WorkerWebSocketChannel. | 80 // For WorkerWebSocketChannel. |
| 81 virtual void send(PassOwnPtr<Vector<char> >) = 0; | 81 virtual void send(PassOwnPtr<Vector<char>>) = 0; |
| 82 | 82 |
| 83 // Do not call |send| after calling this method. | 83 // Do not call |send| after calling this method. |
| 84 virtual void close(int code, const String& reason) = 0; | 84 virtual void close(int code, const String& reason) = 0; |
| 85 | 85 |
| 86 // Log the reason text and close the connection. Will call didClose(). | 86 // Log the reason text and close the connection. Will call didClose(). |
| 87 // The MessageLevel parameter will be used for the level of the message | 87 // The MessageLevel parameter will be used for the level of the message |
| 88 // shown at the devtool console. | 88 // shown at the devtool console. |
| 89 // sourceURL and lineNumber parameters may be shown with the reason text | 89 // sourceURL and lineNumber parameters may be shown with the reason text |
| 90 // at the devtool console. | 90 // at the devtool console. |
| 91 // Even if sourceURL and lineNumber are specified, they may be ignored | 91 // Even if sourceURL and lineNumber are specified, they may be ignored |
| 92 // and the "current" url and the line number in the sense of | 92 // and the "current" url and the line number in the sense of |
| 93 // JavaScript execution may be shown if this method is called in | 93 // JavaScript execution may be shown if this method is called in |
| 94 // a JS execution context. | 94 // a JS execution context. |
| 95 // You can specify String() and 0 for sourceURL and lineNumber | 95 // You can specify String() and 0 for sourceURL and lineNumber |
| 96 // respectively, if you can't / needn't provide the information. | 96 // respectively, if you can't / needn't provide the information. |
| 97 virtual void fail(const String& reason, MessageLevel, const String& sourceUR
L, unsigned lineNumber) = 0; | 97 virtual void fail(const String& reason, MessageLevel, const String& sourceUR
L, unsigned lineNumber) = 0; |
| 98 | 98 |
| 99 // Do not call any methods after calling this method. | 99 // Do not call any methods after calling this method. |
| 100 virtual void disconnect() = 0; // Will suppress didClose(). | 100 virtual void disconnect() = 0; // Will suppress didClose(). |
| 101 | 101 |
| 102 virtual ~WebSocketChannel() { } | 102 virtual ~WebSocketChannel() { } |
| 103 | 103 |
| 104 virtual void trace(Visitor*) { } | 104 virtual void trace(Visitor*) { } |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| 108 | 108 |
| 109 #endif // WebSocketChannel_h | 109 #endif // WebSocketChannel_h |
| OLD | NEW |