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

Side by Side Diff: Source/modules/websockets/WorkerThreadableWebSocketChannel.h

Issue 334873002: [WebSocket] Make subprotocol and extensions live in WebSocket (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; 66 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
67 public: 67 public:
68 static PassRefPtrWillBeRawPtr<WebSocketChannel> create(WorkerGlobalScope& wo rkerGlobalScope, WebSocketChannelClient* client, const String& sourceURL, unsign ed lineNumber) 68 static PassRefPtrWillBeRawPtr<WebSocketChannel> create(WorkerGlobalScope& wo rkerGlobalScope, WebSocketChannelClient* client, const String& sourceURL, unsign ed lineNumber)
69 { 69 {
70 return adoptRefWillBeRefCountedGarbageCollected(new WorkerThreadableWebS ocketChannel(workerGlobalScope, client, sourceURL, lineNumber)); 70 return adoptRefWillBeRefCountedGarbageCollected(new WorkerThreadableWebS ocketChannel(workerGlobalScope, client, sourceURL, lineNumber));
71 } 71 }
72 virtual ~WorkerThreadableWebSocketChannel(); 72 virtual ~WorkerThreadableWebSocketChannel();
73 73
74 // WebSocketChannel functions. 74 // WebSocketChannel functions.
75 virtual bool connect(const KURL&, const String& protocol) OVERRIDE; 75 virtual bool connect(const KURL&, const String& protocol) OVERRIDE;
76 virtual String subprotocol() OVERRIDE;
77 virtual String extensions() OVERRIDE;
78 virtual WebSocketChannel::SendResult send(const String& message) OVERRIDE; 76 virtual WebSocketChannel::SendResult send(const String& message) OVERRIDE;
79 virtual WebSocketChannel::SendResult send(const ArrayBuffer&, unsigned byteO ffset, unsigned byteLength) OVERRIDE; 77 virtual WebSocketChannel::SendResult send(const ArrayBuffer&, unsigned byteO ffset, unsigned byteLength) OVERRIDE;
80 virtual WebSocketChannel::SendResult send(PassRefPtr<BlobDataHandle>) OVERRI DE; 78 virtual WebSocketChannel::SendResult send(PassRefPtr<BlobDataHandle>) OVERRI DE;
81 virtual WebSocketChannel::SendResult send(PassOwnPtr<Vector<char> >) OVERRID E 79 virtual WebSocketChannel::SendResult send(PassOwnPtr<Vector<char> >) OVERRID E
82 { 80 {
83 ASSERT_NOT_REACHED(); 81 ASSERT_NOT_REACHED();
84 return WebSocketChannel::SendFail; 82 return WebSocketChannel::SendFail;
85 } 83 }
86 virtual unsigned long bufferedAmount() const OVERRIDE; 84 virtual unsigned long bufferedAmount() const OVERRIDE;
87 virtual void close(int code, const String& reason) OVERRIDE; 85 virtual void close(int code, const String& reason) OVERRIDE;
(...skipping 22 matching lines...) Expand all
110 void sendArrayBuffer(PassOwnPtr<Vector<char> >); 108 void sendArrayBuffer(PassOwnPtr<Vector<char> >);
111 void sendBlob(PassRefPtr<BlobDataHandle>); 109 void sendBlob(PassRefPtr<BlobDataHandle>);
112 void bufferedAmount(); 110 void bufferedAmount();
113 void close(int code, const String& reason); 111 void close(int code, const String& reason);
114 void fail(const String& reason, MessageLevel, const String& sourceURL, u nsigned lineNumber); 112 void fail(const String& reason, MessageLevel, const String& sourceURL, u nsigned lineNumber);
115 void disconnect(); 113 void disconnect();
116 void suspend(); 114 void suspend();
117 void resume(); 115 void resume();
118 116
119 // WebSocketChannelClient functions. 117 // WebSocketChannelClient functions.
120 virtual void didConnect() OVERRIDE; 118 virtual void didConnect(const String& subprotocol, const String& extensi ons) OVERRIDE;
121 virtual void didReceiveMessage(const String& message) OVERRIDE; 119 virtual void didReceiveMessage(const String& message) OVERRIDE;
122 virtual void didReceiveBinaryData(PassOwnPtr<Vector<char> >) OVERRIDE; 120 virtual void didReceiveBinaryData(PassOwnPtr<Vector<char> >) OVERRIDE;
123 virtual void didUpdateBufferedAmount(unsigned long bufferedAmount) OVERR IDE; 121 virtual void didUpdateBufferedAmount(unsigned long bufferedAmount) OVERR IDE;
124 virtual void didStartClosingHandshake() OVERRIDE; 122 virtual void didStartClosingHandshake() OVERRIDE;
125 virtual void didClose(unsigned long unhandledBufferedAmount, ClosingHand shakeCompletionStatus, unsigned short code, const String& reason) OVERRIDE; 123 virtual void didClose(unsigned long unhandledBufferedAmount, ClosingHand shakeCompletionStatus, unsigned short code, const String& reason) OVERRIDE;
126 virtual void didReceiveMessageError() OVERRIDE; 124 virtual void didReceiveMessageError() OVERRIDE;
127 125
128 private: 126 private:
129 Peer(PassRefPtr<WeakReference<Peer> >, PassRefPtrWillBeRawPtr<Threadable WebSocketChannelClientWrapper>, WorkerLoaderProxy&, ExecutionContext*, const Str ing& sourceURL, unsigned lineNumber, PassOwnPtr<ThreadableWebSocketChannelSyncHe lper>); 127 Peer(PassRefPtr<WeakReference<Peer> >, PassRefPtrWillBeRawPtr<Threadable WebSocketChannelClientWrapper>, WorkerLoaderProxy&, ExecutionContext*, const Str ing& sourceURL, unsigned lineNumber, PassOwnPtr<ThreadableWebSocketChannelSyncHe lper>);
130 128
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 182
185 const RefPtrWillBeMember<ThreadableWebSocketChannelClientWrapper> m_workerCl ientWrapper; 183 const RefPtrWillBeMember<ThreadableWebSocketChannelClientWrapper> m_workerCl ientWrapper;
186 RefPtr<Bridge> m_bridge; 184 RefPtr<Bridge> m_bridge;
187 String m_sourceURLAtConnection; 185 String m_sourceURLAtConnection;
188 unsigned m_lineNumberAtConnection; 186 unsigned m_lineNumberAtConnection;
189 }; 187 };
190 188
191 } // namespace WebCore 189 } // namespace WebCore
192 190
193 #endif // WorkerThreadableWebSocketChannel_h 191 #endif // WorkerThreadableWebSocketChannel_h
OLDNEW
« no previous file with comments | « Source/modules/websockets/WebSocketTest.cpp ('k') | Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698