summaryrefslogtreecommitdiffstats
path: root/net/websockets
Commit message (Collapse)AuthorAgeFilesLines
* Refactor WebSocket handshake.ukai@chromium.org2010-06-035-194/+595
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/2452001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48816 0039d316-1c4b-4281-b951-d872f2087c98
* Fix regression of websocket/tests/simple-stress.htmlukai@chromium.org2010-06-014-16/+38
| | | | | | | | | | | | | | | | | | Since stress-test.html tries to send 256K message, but we'll set 32K for max_pending_send_allowed in SocketStream. Thus, WebCore::SocketStreamHandle won't send full websocket frame for such large message since WebSocketJob doesn't notify OnSentData at all. Don't parse websocket frame for sending to avoid this issue for now. Also disable buffering and parsing websocket frame for receiving to fix performance regression. BUG=32018 TEST=LayoutTests/websocket/tests/stress-test.html passes Review URL: http://codereview.chromium.org/2453002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48629 0039d316-1c4b-4281-b951-d872f2087c98
* Factor out WebSocket frame handler out of WebSocketJob.ukai@chromium.org2010-06-017-144/+562
| | | | | | | | | | | | | WebSocket frame handler might be used to count number of frames, variance of type or length of frame. It might be also used to compress/decompress message in websocket frame. BUG=none TEST=none Review URL: http://codereview.chromium.org/2078002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48615 0039d316-1c4b-4281-b951-d872f2087c98
* Don't process the same address for websocket throttling.ukai@chromium.org2010-04-212-0/+41
| | | | | | | | | | | | | | Host resolver might return address list that contains the same address twice or more. In this case, we should not process the address for websocket throttling multiple times. If we don't have duplicate check of address, it would put the job throttle by the job itself (deadlock). I think this is cause of failure in Linux perf (webkit.org) bot and websocket fail to connect localhost on ubuntu (crbug.com/36652) BUG=36652,41319,40995 TEST=none Review URL: http://codereview.chromium.org/1750001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45156 0039d316-1c4b-4281-b951-d872f2087c98
* Fix websocket key generation algorithm.ukai@chromium.org2010-04-201-5/+5
| | | | | | | | | | | | http://html5.org/tools/web-apps-tracker?from=5054&to=5055 changed the order to insert random character and space in key. BUG=none TEST=none Review URL: http://codereview.chromium.org/1631023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45015 0039d316-1c4b-4281-b951-d872f2087c98
* SendPending() does nothing if socket_stream_ == NULL.ukai@chromium.org2010-04-071-1/+4
| | | | | | | | | | | | | | | | It might be socket_stream_ == NULL when SendPending() is called for wss: URL in websocket_experiment. SendPending() will be called asynchronously from OnConnected or OnSentData, and DoClose() might run before SendPending() runs (especially for SSL case). If socket_stream_ is NULL, it means it must be already closed and do nothing in SendPending(). BUG=none TEST=none Review URL: http://codereview.chromium.org/1632002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43810 0039d316-1c4b-4281-b951-d872f2087c98
* Update new WebSocket API.ukai@chromium.org2010-04-053-27/+95
| | | | | | | | | | | | | | Add new readyState CLOSING. Fix close() to match the API spec. OnError reports WebSocket error, and OnSocketError reports socket level error OnClose reports was_clean. BUG=none TEST=none Review URL: http://codereview.chromium.org/1587008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43605 0039d316-1c4b-4281-b951-d872f2087c98
* Implement closing handshake described in draft-hixie-thewebsocketprotocol-76.ukai@chromium.org2010-04-022-4/+126
| | | | | | | | | | | | | | | | exchange closing frame (0xFF 0x00) to close the WebSocket connection cleanly. Land it again with eliminating LOG(ERROR), because it got arm build fail by relocation overflow in relocation 10 at line 167 (LOG(ERROR) line) in net/base/keygen_handler_nss.cc TBR=rohitrao,jar BUG=none TEST=none Review URL: http://codereview.chromium.org/1605007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43442 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 43331 - Implement closing handshake described in ↵jar@chromium.org2010-04-012-128/+4
| | | | | | | | | | | | | | | | | | drafthixiethewebsocketprotocol76. [Arm build was seemingly broken by this change.] exchange closing frame (0xFF 0x00) to close the WebSocket connection cleanly. BUG=none TEST=none Review URL: http://codereview.chromium.org/1374004 TBR=ukai@chromium.org Review URL: http://codereview.chromium.org/1549010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43351 0039d316-1c4b-4281-b951-d872f2087c98
* Implement closing handshake described in draft-hixie-thewebsocketprotocol-76.ukai@chromium.org2010-04-012-4/+128
| | | | | | | | | | | exchange closing frame (0xFF 0x00) to close the WebSocket connection cleanly. BUG=none TEST=none Review URL: http://codereview.chromium.org/1374004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43331 0039d316-1c4b-4281-b951-d872f2087c98
* Fix leak in WebSocketThrottleTest::Throttleukai@chromium.org2010-04-011-4/+10
| | | | | | | | | | | | chromium r43192 add check of next_state_ to call DoLoop in SocketStream::Close(), so if next_state_ is STATE_NONE, we don't need socket->AddRef() to balance Release() in SocketStream::Finish(). BUG=39979 TEST=valgrind passes WebSocketThrottleTest Review URL: http://codereview.chromium.org/1517010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43328 0039d316-1c4b-4281-b951-d872f2087c98
* Fix WebSocketJob to pass /key_3/ after handshake request header.ukai@chromium.org2010-03-302-5/+54
| | | | | | | | | BUG=none TEST=WebSocketJob::SimpleHandshakeDraft76 passes Review URL: http://codereview.chromium.org/1256001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43054 0039d316-1c4b-4281-b951-d872f2087c98
* Implement new websocket handshake based on draft-hixie-thewebsocketprotocol-76ukai@chromium.org2010-03-269-216/+900
| | | | | | | | | BUG=none TEST=net_unittests passes Review URL: http://codereview.chromium.org/1108002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42736 0039d316-1c4b-4281-b951-d872f2087c98
* Use FilterHeaders() instead of HttpUtil::StripHeaders().ukai@chromium.org2010-03-251-5/+57
| | | | | | | | | | | | | | | | We want to pass original response headers to WebKit, but just dropping set cookie headers. HttpUtil::StripHeaders() strips malformed headers too, so handshake in websocket/tests/long-invalid-header.html will success unexpectedly. Use FilterHeaders() to preserve malformed headers in response headers. BUG=39062 TEST=handshake fails when malformed header is received. Review URL: http://codereview.chromium.org/1254001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42588 0039d316-1c4b-4281-b951-d872f2087c98
* Try to fix a compile error on ARM.eroman@chromium.org2010-03-231-4/+4
| | | | | | | | | | | | | | | This is a speculative change, to hopefully get the ARM builder compiling again. Lately it has been giving the error that |kHandshakeResponseMessage| is being used before it is initialized: http://build.chromium.org/buildbot/waterfall/builders/Chromium%20Arm/builds/2639/steps/compile/logs/stdio I don't know why it would say this, but perhaps it is getting confused by the multiple statics with the same name in this file. My proposed change removes the static keyword, to see if it has an effect. TBR=ukai Review URL: http://codereview.chromium.org/1217003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42407 0039d316-1c4b-4281-b951-d872f2087c98
* Try to fix flaky websocket tests again.ukai@chromium.org2010-03-233-38/+42
| | | | | | | | | | | | | | | | | | | | | Some websoket layout tests became flaky from r41818. This is because it adds websocket throttling in WebSocketJob. Make sure Close() will call OnClose() even if it is waiting resolving or waiting in throttling queue, so that WebSocketJob is removed from throttling queue and wake up next WebSocketJob. r42074 was reverted because failure in SocketStreamMetrics::OnClose on Linux Builder (Views dbg). Ignore UMA record if the connection has not been established. TBR=tyoshino BUG=38397 TEST=layout tests websocket/tests passes Review URL: http://codereview.chromium.org/1134004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42320 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 42074 - Try to fix flaky websocket tests.amit@chromium.org2010-03-193-38/+37
| | | | | | | | | | | | | | | | | | | Some websoket layout tests became flaky from r41818. This is because it adds websocket throttling in WebSocketJob. Make sure Close() will call OnClose() even if it is waiting resolving or waiting in throttling queue, so that WebSocketJob is removed from throttling queue and wake up next WebSocketJob. BUG=38397 TEST=layout tests websocket/tests passes Review URL: http://codereview.chromium.org/1096001 TBR=ukai@chromium.org Review URL: http://codereview.chromium.org/1120004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42078 0039d316-1c4b-4281-b951-d872f2087c98
* Try to fix flaky websocket tests.ukai@chromium.org2010-03-193-37/+38
| | | | | | | | | | | | | | | | Some websoket layout tests became flaky from r41818. This is because it adds websocket throttling in WebSocketJob. Make sure Close() will call OnClose() even if it is waiting resolving or waiting in throttling queue, so that WebSocketJob is removed from throttling queue and wake up next WebSocketJob. BUG=38397 TEST=layout tests websocket/tests passes Review URL: http://codereview.chromium.org/1096001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42074 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor WebSocket throttling feature.ukai@chromium.org2010-03-176-239/+296
| | | | | | | | | Protocol specific handling should be done in SocketStreamJob subclasss, so websocket throttling should be handled in WebSocketJob. Review URL: http://codereview.chromium.org/669157 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41818 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor WebSocketHandshake out of WebSocket.ukai@chromium.org2010-03-176-356/+543
| | | | | | | | | | | | Make similar code structure with WebKit. Add unittest for WebSocketHandshake. BUG=none TEST=none Review URL: http://codereview.chromium.org/783005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41810 0039d316-1c4b-4281-b951-d872f2087c98
* Fix crash in ExtensionApiTest.FLAKY_WebSocketukai@chromium.org2010-03-011-1/+2
| | | | | | | | | | TBR=darin BUG=none TEST=browser_tests ExtensionApiTest.FLAKY_WebSocket doesn't crash Review URL: http://codereview.chromium.org/660259 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40253 0039d316-1c4b-4281-b951-d872f2087c98
* Support HttpOnly cookie on Web Socketukai@chromium.org2010-03-013-0/+971
| | | | | | | | | | | | | | | | | | | | | | | | Web Socket should send "HttpOnly" cookie when handshaking. In WebKit/WebCore, WebSocketHandshake uses cookieRequestHeaderFieldValue() to get cookies including HttpOnly cookie. However, Chrome doesn't trunk renderer process, so we're not allowed to access HttpOnly cookie in WebCore. Thus, we handle HttpOnly cookies in browser process. Add SocketStreamJob as interface for protocol specific handling on SocketStream. WebSocketJob implements Web Socket specific handling. For now, it handles cookies in Web Socket. It checks Web Socket handshake request message from renderer process, and replaces Cookie: header to include HttpOnly cookies. It also checks Web Socket handshake response message, sets cookies if any, and strips Set-Cookie: header, so that renderer process couldn't see Set-Cookie: header. BUG=35660 TEST=net_unittests and layout_tests passes Review URL: http://codereview.chromium.org/601077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40250 0039d316-1c4b-4281-b951-d872f2087c98
* Pulled out Callback code into base/callback.h. This is the first step ↵akalin@chromium.org2010-02-191-1/+1
| | | | | | | | | | | | | towards redoing the Callback interfaces. Added and removed includes as needed. BUG=35223 TEST=trybots Review URL: http://codereview.chromium.org/646061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39419 0039d316-1c4b-4281-b951-d872f2087c98
* Add bounds checking to StaticSocketDataProvider, to make tests more reliablephajdan.jr@chromium.org2010-02-091-2/+4
| | | | | | | | | | | when they fail. TEST=net_unittests BUG=27567 Review URL: http://codereview.chromium.org/582020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38453 0039d316-1c4b-4281-b951-d872f2087c98
* Minor cleanup: add a sys_addrinfo.h header that hides the platform-specific ↵eroman@chromium.org2009-12-122-14/+2
| | | | | | | | | | includes needed for struct addrinfo / struct sockaddr, since we were duplicating that #if #else logic in a growing number of places. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/491038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34399 0039d316-1c4b-4281-b951-d872f2087c98
* Improve the test coverage of WebSocket class.satorux@chromium.org2009-12-103-18/+152
| | | | | | | | | | | | | The logic for creating the client handshake message is substantially complex so it would be nice to have better test coverage, before it gets more complex. TEST=net_unittests BUG=none Review URL: http://codereview.chromium.org/473003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34241 0039d316-1c4b-4281-b951-d872f2087c98
* Fix WebSocket length parserukai@chromium.org2009-12-072-5/+8
| | | | | | | | | | | | | | Frames denoted by bytes that have the high bit set (0x80 to 0xFF) have a leading length indicator, which is encoded as a series of 7-bit bytes stored in octets with the 8th bit being set for all but the last byte. BUG=none TEST=none Review URL: http://codereview.chromium.org/465094 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33951 0039d316-1c4b-4281-b951-d872f2087c98
* Reduce DLOG in websocket codeukai@chromium.org2009-11-241-7/+6
| | | | | | | | | BUG=28657 TEST=none Review URL: http://codereview.chromium.org/440005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32919 0039d316-1c4b-4281-b951-d872f2087c98
* There was confusion in the mock socket classes due tombelshe@google.com2009-11-111-4/+4
| | | | | | | | | | | | | | | | | | | overlapping names. The MockSocket is not actually a socket. It is an interface for fetching data for reads and writes on a socket. The MockClientSocket and MockTCPClientSocket are the actual sockets. Rename MockSocket to SocketDataProvider. Rename SSLMockSocket to SSLSocketDataProvider. Update all tests to reflect name change. BUG=none TEST=none Review URL: http://codereview.chromium.org/384024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31640 0039d316-1c4b-4281-b951-d872f2087c98
* After further discussion, do not try to handle memory errors, but make ↵vandebo@chromium.org2009-11-101-10/+2
| | | | | | | | | | | assertions about allocation parameters stronger. BUG=25826 TEST=none Review URL: http://codereview.chromium.org/378037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31574 0039d316-1c4b-4281-b951-d872f2087c98
* Add Websocket::DetachDelegateukai@chromium.org2009-11-063-5/+37
| | | | | | | | | | | It is required when websocket live experiment task finished with timed out and detach websocket immediately without waiting OnClose. BUG=none TEST=none Review URL: http://codereview.chromium.org/378010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31219 0039d316-1c4b-4281-b951-d872f2087c98
* Add error reporting in net/websocketsukai@chromium.org2009-11-062-1/+22
| | | | | | | | | | | Fix response code for websocket authentication. BUG=none TEST=none Review URL: http://codereview.chromium.org/368003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31211 0039d316-1c4b-4281-b951-d872f2087c98
* Second patch in making destructors of refcounted objects private.jam@chromium.org2009-11-051-1/+4
| | | | | | | | BUG=26749 Review URL: http://codereview.chromium.org/368001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31165 0039d316-1c4b-4281-b951-d872f2087c98
* Fix kServerHandshakeHeaderukai@chromium.org2009-11-052-9/+9
| | | | | | | | | BUG=none TEST=net_unittests passes Review URL: http://codereview.chromium.org/355039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31085 0039d316-1c4b-4281-b951-d872f2087c98
* Fix memory leak in WebSocketThrottle.ukai@chromium.org2009-11-041-1/+3
| | | | | | | | | | TBR=yuzo, tyoshino BUG=none TEST=net_unittests no memory leak in WebSocketThrottleTest Review URL: http://codereview.chromium.org/364001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30951 0039d316-1c4b-4281-b951-d872f2087c98
* Implement websocket throttling.ukai@chromium.org2009-11-043-0/+526
| | | | | | | | | | | | | | | | Implement the client-side requirements in the spec. 4.1 Handshake 1. If the user agent already has a Web Socket connection to the remote host (IP address) identified by /host/, even if known by another name, wait until that connection has been established or for that connection to have failed. BUG=none TEST=net_unittests passes Review URL: http://codereview.chromium.org/342052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30949 0039d316-1c4b-4281-b951-d872f2087c98
* Handle out of memory in GrowableIOBuffer more gracefully.vandebo@chromium.org2009-10-281-2/+2
| | | | | | | | | BUG=25826 TEST=none Review URL: http://codereview.chromium.org/338049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30287 0039d316-1c4b-4281-b951-d872f2087c98
* Add unittest for WebSocket::ProcessFrameData.ukai@chromium.org2009-10-233-65/+189
| | | | | | | | | | | | | | It catches a bug fixed in r29760. Also find another bug and fixed in this change. (same bug found in WebKit code. reported as http://bugs.webkit.org/show_bug.cgi?id=30668) BUG=none TEST=net_unittests passes Review URL: http://codereview.chromium.org/307036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29864 0039d316-1c4b-4281-b951-d872f2087c98
* Fix calculation of length in websocket.cc.craig.schlenter@chromium.org2009-10-221-1/+1
| | | | | | | | | | The compiler warned about this. See http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-49#section-4.2 for how to calculate the length. Review URL: http://codereview.chromium.org/293055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29760 0039d316-1c4b-4281-b951-d872f2087c98
* WebSocket protocol handler for live experiment (again)ukai@chromium.org2009-10-213-0/+871
| | | | | | | | | | | | | | This is in-browser-process WebSocket protocol handler, which will be used inWebSocket live experiment. Change WebSocket::Delegate to WebSocketDelegate to avoid compile error on MSVC. BUG=none TEST=net_unittests passes Review URL: http://codereview.chromium.org/300035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29624 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r29614 "WebSocket protocol handler for live experiment."ukai@chromium.org2009-10-213-868/+0
| | | | | | | | | | | | It caused compile error on Modules XP and Vista. TBR=tkent BUG=none TEST=none Review URL: http://codereview.chromium.org/312001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29619 0039d316-1c4b-4281-b951-d872f2087c98
* WebSocket protocol handler for live experiment.ukai@chromium.org2009-10-213-0/+868
This is in-browser-process WebSocket protocol handler, which will be used in WebSocket live experiment. BUG=none TEST=net_unittests passes Review URL: http://codereview.chromium.org/304014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29614 0039d316-1c4b-4281-b951-d872f2087c98