diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 04:43:21 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 04:43:21 +0000 |
commit | 7adaccba309723e23cf444e4d64b5d5a761591e3 (patch) | |
tree | 9e95f5bdcde65854be5bfc18853c23a00bcc1749 /net | |
parent | 595c0ffc98abcad93010c94da8e99a87efce80c8 (diff) | |
download | chromium_src-7adaccba309723e23cf444e4d64b5d5a761591e3.zip chromium_src-7adaccba309723e23cf444e4d64b5d5a761591e3.tar.gz chromium_src-7adaccba309723e23cf444e4d64b5d5a761591e3.tar.bz2 |
Add a command line switch to enable flip sockets.
With this change, flip code is now compiled
and the limited unit tests actually run.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/259064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_network_layer.cc | 12 | ||||
-rw-r--r-- | net/http/http_network_layer.h | 4 | ||||
-rw-r--r-- | net/net.gyp | 16 |
3 files changed, 31 insertions, 1 deletions
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc index 7097cd9..b8ac600 100644 --- a/net/http/http_network_layer.cc +++ b/net/http/http_network_layer.cc @@ -5,6 +5,7 @@ #include "net/http/http_network_layer.h" #include "base/logging.h" +#include "net/flip/flip_network_transaction.h" #include "net/http/http_network_session.h" #include "net/http/http_network_transaction.h" #include "net/socket/client_socket_factory.h" @@ -33,6 +34,7 @@ HttpTransactionFactory* HttpNetworkLayer::CreateFactory( } //----------------------------------------------------------------------------- +bool HttpNetworkLayer::enable_flip_ = false; HttpNetworkLayer::HttpNetworkLayer(ClientSocketFactory* socket_factory, HostResolver* host_resolver, @@ -63,7 +65,10 @@ int HttpNetworkLayer::CreateTransaction(scoped_ptr<HttpTransaction>* trans) { if (suspended_) return ERR_NETWORK_IO_SUSPENDED; - trans->reset(new HttpNetworkTransaction(GetSession())); + if (enable_flip_) + trans->reset(new FlipNetworkTransaction(GetSession())); + else + trans->reset(new HttpNetworkTransaction(GetSession())); return OK; } @@ -91,4 +96,9 @@ HttpNetworkSession* HttpNetworkLayer::GetSession() { return session_; } +// static +void HttpNetworkLayer::EnableFlip(bool enable) { + enable_flip_ = enable; +} + } // namespace net diff --git a/net/http/http_network_layer.h b/net/http/http_network_layer.h index 7defb4e..7344c7b 100644 --- a/net/http/http_network_layer.h +++ b/net/http/http_network_layer.h @@ -50,6 +50,9 @@ class HttpNetworkLayer : public HttpTransactionFactory { virtual HttpNetworkSession* GetSession(); virtual void Suspend(bool suspend); + // Enable the flip protocol. Default is false. + static void EnableFlip(bool enable); + private: // The factory we will use to create network sockets. ClientSocketFactory* socket_factory_; @@ -64,6 +67,7 @@ class HttpNetworkLayer : public HttpTransactionFactory { scoped_refptr<HttpNetworkSession> session_; bool suspended_; + static bool enable_flip_; }; } // namespace net diff --git a/net/net.gyp b/net/net.gyp index 9c7ecdc..ed1b851 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -192,6 +192,19 @@ 'disk_cache/storage_block.h', 'disk_cache/trace.cc', 'disk_cache/trace.h', + 'flip/flip_bitmasks.h', + 'flip/flip_frame_builder.cc', + 'flip/flip_frame_builder.h', + 'flip/flip_framer.cc', + 'flip/flip_framer.h', + 'flip/flip_network_transaction.cc', + 'flip/flip_network_transaction.h', + 'flip/flip_protocol.h', + 'flip/flip_session.cc', + 'flip/flip_session.h', + 'flip/flip_session_pool.cc', + 'flip/flip_session_pool.h', + 'flip/flip_transaction_factory.h', 'ftp/ftp_auth_cache.cc', 'ftp/ftp_auth_cache.h', 'ftp/ftp_ctrl_response_buffer.cc', @@ -497,6 +510,9 @@ 'ftp/ftp_network_transaction_unittest.cc', 'ftp/ftp_util_unittest.cc', 'http/des_unittest.cc', + 'flip/flip_framer_test.cc', + 'flip/flip_network_transaction_unittest.cc', + 'flip/flip_session_unittest.cc', 'http/http_auth_cache_unittest.cc', 'http/http_auth_handler_basic_unittest.cc', 'http/http_auth_handler_digest_unittest.cc', |