diff options
author | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-01 02:37:13 +0000 |
---|---|---|
committer | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-01 02:37:13 +0000 |
commit | 6a2c3677f12c18bcc1b57c37becd4e1149f0c8e4 (patch) | |
tree | b0c0a2218130e3ceda8d983b768d0b693513a795 /net/socket_stream/socket_stream_job.cc | |
parent | 260ce69aad6758077a585ebe5f5c040960e506a0 (diff) | |
download | chromium_src-6a2c3677f12c18bcc1b57c37becd4e1149f0c8e4.zip chromium_src-6a2c3677f12c18bcc1b57c37becd4e1149f0c8e4.tar.gz chromium_src-6a2c3677f12c18bcc1b57c37becd4e1149f0c8e4.tar.bz2 |
Support HttpOnly cookie on Web Socket
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
Diffstat (limited to 'net/socket_stream/socket_stream_job.cc')
-rw-r--r-- | net/socket_stream/socket_stream_job.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/net/socket_stream/socket_stream_job.cc b/net/socket_stream/socket_stream_job.cc new file mode 100644 index 0000000..c8849a5 --- /dev/null +++ b/net/socket_stream/socket_stream_job.cc @@ -0,0 +1,27 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/socket_stream/socket_stream_job.h" + +#include "net/socket_stream/socket_stream_job_manager.h" + +namespace net { + +static SocketStreamJobManager* GetJobManager() { + return Singleton<SocketStreamJobManager>::get(); +} + +// static +SocketStreamJob::ProtocolFactory* SocketStreamJob::RegisterProtocolFactory( + const std::string& scheme, ProtocolFactory* factory) { + return GetJobManager()->RegisterProtocolFactory(scheme, factory); +} + +// static +SocketStreamJob* SocketStreamJob::CreateSocketStreamJob( + const GURL& url, SocketStream::Delegate* delegate) { + return GetJobManager()->CreateJob(url, delegate); +} + +} // namespace net |