diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-21 23:52:07 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-21 23:52:07 +0000 |
commit | 650e2cae692b1ec5d4f079043b466c59abef4f4b (patch) | |
tree | 77f4fd57ef1fabb4b25445e7c27297749f27f425 /net | |
parent | 53f912877e60a6adbf93f399f7ce56cbbc366120 (diff) | |
download | chromium_src-650e2cae692b1ec5d4f079043b466c59abef4f4b.zip chromium_src-650e2cae692b1ec5d4f079043b466c59abef4f4b.tar.gz chromium_src-650e2cae692b1ec5d4f079043b466c59abef4f4b.tar.bz2 |
Expand the options for how FLIP runs. The GFE team needs
the ability to run a client with ssl & compression turned off.
Update the command line to accomodate.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/315006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29741 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/flip/flip_framer.h | 4 | ||||
-rw-r--r-- | net/flip/flip_session.h | 1 | ||||
-rw-r--r-- | net/http/http_network_layer.cc | 19 | ||||
-rw-r--r-- | net/http/http_network_layer.h | 11 |
4 files changed, 30 insertions, 5 deletions
diff --git a/net/flip/flip_framer.h b/net/flip/flip_framer.h index 8f89c30..d3cae28 100644 --- a/net/flip/flip_framer.h +++ b/net/flip/flip_framer.h @@ -23,6 +23,7 @@ typedef struct z_stream_s z_stream; // Forward declaration for zlib. namespace net { class FlipNetworkTransactionTest; +class HttpNetworkLayer; } namespace flip { @@ -199,8 +200,9 @@ class FlipFramer { protected: FRIEND_TEST(FlipFramerTest, HeaderBlockBarfsOnOutOfOrderHeaders); - friend class net::FlipNetworkTransactionTest; friend class flip::TestFlipVisitor; + friend class net::FlipNetworkTransactionTest; + friend class net::HttpNetworkLayer; // This is temporary for the server. // For ease of testing we can tweak compression on/off. void set_enable_compression(bool value); diff --git a/net/flip/flip_session.h b/net/flip/flip_session.h index 1ee874b..38d6256 100644 --- a/net/flip/flip_session.h +++ b/net/flip/flip_session.h @@ -114,6 +114,7 @@ class FlipSession : public base::RefCounted<FlipSession>, protected: FRIEND_TEST(FlipNetworkTransactionTest, Connect); friend class FlipSessionPool; + friend class HttpNetworkLayer; // Temporary for server. // Provide access to the framer for testing. flip::FlipFramer* GetFramer() { return &flip_framer_; } diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc index b8ac600..1857e52 100644 --- a/net/http/http_network_layer.cc +++ b/net/http/http_network_layer.cc @@ -5,7 +5,9 @@ #include "net/http/http_network_layer.h" #include "base/logging.h" +#include "net/flip/flip_framer.h" #include "net/flip/flip_network_transaction.h" +#include "net/flip/flip_session.h" #include "net/http/http_network_session.h" #include "net/http/http_network_transaction.h" #include "net/socket/client_socket_factory.h" @@ -97,8 +99,21 @@ HttpNetworkSession* HttpNetworkLayer::GetSession() { } // static -void HttpNetworkLayer::EnableFlip(bool enable) { - enable_flip_ = enable; +void HttpNetworkLayer::EnableFlip(const std::string& mode) { + static const std::string kDisableSSL("no-ssl"); + static const std::string kDisableCompression("no-compress"); + static const std::string kDisableEverything("no-ssl-no-compress"); + + // Enable flip mode. + enable_flip_ = true; + + // Disable SSL + if (mode == kDisableEverything || mode == kDisableSSL) + FlipSession::SetSSLMode(false); + + // Disable compression + if (mode == kDisableEverything || mode == kDisableCompression) + flip::FlipFramer::set_enable_compression_default(false); } } // namespace net diff --git a/net/http/http_network_layer.h b/net/http/http_network_layer.h index 7344c7b..84f966d 100644 --- a/net/http/http_network_layer.h +++ b/net/http/http_network_layer.h @@ -5,6 +5,8 @@ #ifndef NET_HTTP_HTTP_NETWORK_LAYER_H_ #define NET_HTTP_HTTP_NETWORK_LAYER_H_ +#include <string> + #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "net/http/http_transaction_factory.h" @@ -50,8 +52,13 @@ class HttpNetworkLayer : public HttpTransactionFactory { virtual HttpNetworkSession* GetSession(); virtual void Suspend(bool suspend); - // Enable the flip protocol. Default is false. - static void EnableFlip(bool enable); + // Enable the flip protocol. + // Without calling this function, FLIP is disabled. The mode can be: + // "" : (default) SSL and compression are enabled. + // "no-ssl" : disables SSL. + // "no-compress" : disables compression. + // "none" : disables both SSL and compression. + static void EnableFlip(const std::string& mode); private: // The factory we will use to create network sockets. |