Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: third_party/WebKit/Source/modules/websockets/DOMWebSocket.h

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: update comment, add TODO Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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
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 DOMWebSocket_h 31 #ifndef DOMWebSocket_h
32 #define DOMWebSocket_h 32 #define DOMWebSocket_h
33 33
34 #include <stddef.h>
35 #include <stdint.h>
36 #include <memory>
34 #include "bindings/core/v8/ActiveScriptWrappable.h" 37 #include "bindings/core/v8/ActiveScriptWrappable.h"
35 #include "bindings/core/v8/ScriptWrappable.h" 38 #include "bindings/core/v8/ScriptWrappable.h"
39 #include "core/dom/NotShared.h"
36 #include "core/dom/SuspendableObject.h" 40 #include "core/dom/SuspendableObject.h"
37 #include "core/events/EventListener.h" 41 #include "core/events/EventListener.h"
38 #include "core/events/EventTarget.h" 42 #include "core/events/EventTarget.h"
39 #include "modules/EventTargetModules.h" 43 #include "modules/EventTargetModules.h"
40 #include "modules/ModulesExport.h" 44 #include "modules/ModulesExport.h"
41 #include "modules/websockets/WebSocketChannel.h" 45 #include "modules/websockets/WebSocketChannel.h"
42 #include "modules/websockets/WebSocketChannelClient.h" 46 #include "modules/websockets/WebSocketChannelClient.h"
43 #include "platform/Timer.h" 47 #include "platform/Timer.h"
44 #include "platform/heap/Handle.h" 48 #include "platform/heap/Handle.h"
45 #include "platform/weborigin/KURL.h" 49 #include "platform/weborigin/KURL.h"
46 #include "wtf/Deque.h" 50 #include "wtf/Deque.h"
47 #include "wtf/Forward.h" 51 #include "wtf/Forward.h"
48 #include "wtf/PassRefPtr.h" 52 #include "wtf/PassRefPtr.h"
49 #include "wtf/RefPtr.h" 53 #include "wtf/RefPtr.h"
50 #include "wtf/text/WTFString.h" 54 #include "wtf/text/WTFString.h"
51 #include <memory>
52 #include <stddef.h>
53 #include <stdint.h>
54 55
55 namespace blink { 56 namespace blink {
56 57
57 class Blob; 58 class Blob;
58 class DOMArrayBuffer; 59 class DOMArrayBuffer;
59 class DOMArrayBufferView; 60 class DOMArrayBufferView;
60 class ExceptionState; 61 class ExceptionState;
61 class ExecutionContext; 62 class ExecutionContext;
62 class StringOrStringSequence; 63 class StringOrStringSequence;
63 64
(...skipping 19 matching lines...) Expand all
83 ~DOMWebSocket() override; 84 ~DOMWebSocket() override;
84 85
85 enum State { kConnecting = 0, kOpen = 1, kClosing = 2, kClosed = 3 }; 86 enum State { kConnecting = 0, kOpen = 1, kClosing = 2, kClosed = 3 };
86 87
87 void Connect(const String& url, 88 void Connect(const String& url,
88 const Vector<String>& protocols, 89 const Vector<String>& protocols,
89 ExceptionState&); 90 ExceptionState&);
90 91
91 void send(const String& message, ExceptionState&); 92 void send(const String& message, ExceptionState&);
92 void send(DOMArrayBuffer*, ExceptionState&); 93 void send(DOMArrayBuffer*, ExceptionState&);
93 void send(DOMArrayBufferView*, ExceptionState&); 94 void send(NotShared<DOMArrayBufferView>, ExceptionState&);
94 void send(Blob*, ExceptionState&); 95 void send(Blob*, ExceptionState&);
95 96
96 // To distinguish close method call with the code parameter from one 97 // To distinguish close method call with the code parameter from one
97 // without, we have these three signatures. Use of 98 // without, we have these three signatures. Use of
98 // Optional=DefaultIsUndefined in the IDL file doesn't help for now since 99 // Optional=DefaultIsUndefined in the IDL file doesn't help for now since
99 // it's bound to a value of 0 which is indistinguishable from the case 0 100 // it's bound to a value of 0 which is indistinguishable from the case 0
100 // is passed as code parameter. 101 // is passed as code parameter.
101 void close(unsigned short code, const String& reason, ExceptionState&); 102 void close(unsigned short code, const String& reason, ExceptionState&);
102 void close(ExceptionState&); 103 void close(ExceptionState&);
103 void close(unsigned short code, ExceptionState&); 104 void close(unsigned short code, ExceptionState&);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 String subprotocol_; 253 String subprotocol_;
253 String extensions_; 254 String extensions_;
254 255
255 Member<EventQueue> event_queue_; 256 Member<EventQueue> event_queue_;
256 TaskRunnerTimer<DOMWebSocket> buffered_amount_consume_timer_; 257 TaskRunnerTimer<DOMWebSocket> buffered_amount_consume_timer_;
257 }; 258 };
258 259
259 } // namespace blink 260 } // namespace blink
260 261
261 #endif // DOMWebSocket_h 262 #endif // DOMWebSocket_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698