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

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

Issue 311993006: [WebSocket] bufferedAmount should not decrease inside a task. (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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 WebSocketChannel::SendResult send(const String& message) OVERRIDE; 76 virtual WebSocketChannel::SendResult send(const String& message) OVERRIDE;
77 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;
78 virtual WebSocketChannel::SendResult send(PassRefPtr<BlobDataHandle>) OVERRI DE; 78 virtual WebSocketChannel::SendResult send(PassRefPtr<BlobDataHandle>) OVERRI DE;
79 virtual WebSocketChannel::SendResult send(PassOwnPtr<Vector<char> >) OVERRID E 79 virtual WebSocketChannel::SendResult send(PassOwnPtr<Vector<char> >) OVERRID E
80 { 80 {
81 ASSERT_NOT_REACHED(); 81 ASSERT_NOT_REACHED();
82 return WebSocketChannel::SendFail; 82 return WebSocketChannel::SendFail;
83 } 83 }
84 virtual unsigned long bufferedAmount() const OVERRIDE;
85 virtual void close(int code, const String& reason) OVERRIDE; 84 virtual void close(int code, const String& reason) OVERRIDE;
86 virtual void fail(const String& reason, MessageLevel, const String&, unsigne d) OVERRIDE; 85 virtual void fail(const String& reason, MessageLevel, const String&, unsigne d) OVERRIDE;
87 virtual void disconnect() OVERRIDE; // Will suppress didClose(). 86 virtual void disconnect() OVERRIDE; // Will suppress didClose().
88 virtual void suspend() OVERRIDE { } 87 virtual void suspend() OVERRIDE { }
89 virtual void resume() OVERRIDE { } 88 virtual void resume() OVERRIDE { }
90 89
91 virtual void trace(Visitor*) OVERRIDE; 90 virtual void trace(Visitor*) OVERRIDE;
92 91
93 // Generated by the bridge. The Peer is destructed by an async call from 92 // Generated by the bridge. The Peer is destructed by an async call from
94 // Bridge, and may outlive the bridge. All methods of this class must 93 // Bridge, and may outlive the bridge. All methods of this class must
(...skipping 14 matching lines...) Expand all
109 void sendBlob(PassRefPtr<BlobDataHandle>); 108 void sendBlob(PassRefPtr<BlobDataHandle>);
110 void bufferedAmount(); 109 void bufferedAmount();
111 void close(int code, const String& reason); 110 void close(int code, const String& reason);
112 void fail(const String& reason, MessageLevel, const String& sourceURL, u nsigned lineNumber); 111 void fail(const String& reason, MessageLevel, const String& sourceURL, u nsigned lineNumber);
113 void disconnect(); 112 void disconnect();
114 113
115 // WebSocketChannelClient functions. 114 // WebSocketChannelClient functions.
116 virtual void didConnect(const String& subprotocol, const String& extensi ons) OVERRIDE; 115 virtual void didConnect(const String& subprotocol, const String& extensi ons) OVERRIDE;
117 virtual void didReceiveMessage(const String& message) OVERRIDE; 116 virtual void didReceiveMessage(const String& message) OVERRIDE;
118 virtual void didReceiveBinaryData(PassOwnPtr<Vector<char> >) OVERRIDE; 117 virtual void didReceiveBinaryData(PassOwnPtr<Vector<char> >) OVERRIDE;
119 virtual void didUpdateBufferedAmount(unsigned long bufferedAmount) OVERR IDE; 118 virtual void didConsumeBufferedAmount(unsigned long) OVERRIDE;
120 virtual void didStartClosingHandshake() OVERRIDE; 119 virtual void didStartClosingHandshake() OVERRIDE;
121 virtual void didClose(unsigned long unhandledBufferedAmount, ClosingHand shakeCompletionStatus, unsigned short code, const String& reason) OVERRIDE; 120 virtual void didClose(ClosingHandshakeCompletionStatus, unsigned short c ode, const String& reason) OVERRIDE;
122 virtual void didReceiveMessageError() OVERRIDE; 121 virtual void didReceiveMessageError() OVERRIDE;
123 122
124 private: 123 private:
125 Peer(PassRefPtr<WeakReference<Peer> >, PassRefPtrWillBeRawPtr<Threadable WebSocketChannelClientWrapper>, WorkerLoaderProxy&, ExecutionContext*, const Str ing& sourceURL, unsigned lineNumber, PassOwnPtr<ThreadableWebSocketChannelSyncHe lper>); 124 Peer(PassRefPtr<WeakReference<Peer> >, PassRefPtrWillBeRawPtr<Threadable WebSocketChannelClientWrapper>, WorkerLoaderProxy&, ExecutionContext*, const Str ing& sourceURL, unsigned lineNumber, PassOwnPtr<ThreadableWebSocketChannelSyncHe lper>);
126 125
127 const RefPtrWillBePersistent<ThreadableWebSocketChannelClientWrapper> m_ workerClientWrapper; 126 const RefPtrWillBePersistent<ThreadableWebSocketChannelClientWrapper> m_ workerClientWrapper;
128 WorkerLoaderProxy& m_loaderProxy; 127 WorkerLoaderProxy& m_loaderProxy;
129 RefPtrWillBePersistent<WebSocketChannel> m_mainWebSocketChannel; 128 RefPtrWillBePersistent<WebSocketChannel> m_mainWebSocketChannel;
130 OwnPtr<ThreadableWebSocketChannelSyncHelper> m_syncHelper; 129 OwnPtr<ThreadableWebSocketChannelSyncHelper> m_syncHelper;
131 WeakPtrFactory<Peer> m_weakFactory; 130 WeakPtrFactory<Peer> m_weakFactory;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 177
179 const RefPtrWillBeMember<ThreadableWebSocketChannelClientWrapper> m_workerCl ientWrapper; 178 const RefPtrWillBeMember<ThreadableWebSocketChannelClientWrapper> m_workerCl ientWrapper;
180 RefPtr<Bridge> m_bridge; 179 RefPtr<Bridge> m_bridge;
181 String m_sourceURLAtConnection; 180 String m_sourceURLAtConnection;
182 unsigned m_lineNumberAtConnection; 181 unsigned m_lineNumberAtConnection;
183 }; 182 };
184 183
185 } // namespace WebCore 184 } // namespace WebCore
186 185
187 #endif // WorkerThreadableWebSocketChannel_h 186 #endif // WorkerThreadableWebSocketChannel_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698