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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebSocketChannel_h | 31 #ifndef WebSocketChannel_h |
32 #define WebSocketChannel_h | 32 #define WebSocketChannel_h |
33 | 33 |
| 34 #include "bindings/core/v8/SourceLocation.h" |
34 #include "modules/ModulesExport.h" | 35 #include "modules/ModulesExport.h" |
35 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
36 #include "platform/v8_inspector/public/ConsoleTypes.h" | 37 #include "platform/v8_inspector/public/ConsoleTypes.h" |
37 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
38 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
42 class BlobDataHandle; | 43 class BlobDataHandle; |
43 class DOMArrayBuffer; | 44 class DOMArrayBuffer; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 78 |
78 // For WorkerWebSocketChannel. | 79 // For WorkerWebSocketChannel. |
79 virtual void sendTextAsCharVector(PassOwnPtr<Vector<char>>) = 0; | 80 virtual void sendTextAsCharVector(PassOwnPtr<Vector<char>>) = 0; |
80 virtual void sendBinaryAsCharVector(PassOwnPtr<Vector<char>>) = 0; | 81 virtual void sendBinaryAsCharVector(PassOwnPtr<Vector<char>>) = 0; |
81 | 82 |
82 // Do not call |send| after calling this method. | 83 // Do not call |send| after calling this method. |
83 virtual void close(int code, const String& reason) = 0; | 84 virtual void close(int code, const String& reason) = 0; |
84 | 85 |
85 // Log the reason text and close the connection. Will call didClose(). | 86 // Log the reason text and close the connection. Will call didClose(). |
86 // 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 |
87 // shown at the devtool console. | 88 // shown at the devtools console. |
88 // sourceURL and lineNumber parameters may be shown with the reason text | 89 // SourceLocation parameter may be shown with the reason text |
89 // at the devtool console. | 90 // at the devtools console. Even if location is specified, it may be ignored |
90 // Even if sourceURL and lineNumber are specified, they may be ignored | 91 // and the "current" location in the sense of JavaScript execution |
91 // and the "current" url and the line number in the sense of | 92 // may be shown if this method is called in a JS execution context. |
92 // JavaScript execution may be shown if this method is called in | 93 // You can pass null location if unknown. |
93 // a JS execution context. | 94 virtual void fail(const String& reason, MessageLevel, PassOwnPtr<SourceLocat
ion>) = 0; |
94 // You can specify String() and 0 for sourceURL and lineNumber | |
95 // respectively, if you can't / needn't provide the information. | |
96 virtual void fail(const String& reason, MessageLevel, const String& sourceUR
L, unsigned lineNumber) = 0; | |
97 | 95 |
98 // Do not call any methods after calling this method. | 96 // Do not call any methods after calling this method. |
99 virtual void disconnect() = 0; // Will suppress didClose(). | 97 virtual void disconnect() = 0; // Will suppress didClose(). |
100 | 98 |
101 virtual ~WebSocketChannel() { } | 99 virtual ~WebSocketChannel() { } |
102 | 100 |
103 DEFINE_INLINE_VIRTUAL_TRACE() { } | 101 DEFINE_INLINE_VIRTUAL_TRACE() { } |
104 }; | 102 }; |
105 | 103 |
106 } // namespace blink | 104 } // namespace blink |
107 | 105 |
108 #endif // WebSocketChannel_h | 106 #endif // WebSocketChannel_h |
OLD | NEW |