summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authormbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 04:43:21 +0000
committermbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 04:43:21 +0000
commit7adaccba309723e23cf444e4d64b5d5a761591e3 (patch)
tree9e95f5bdcde65854be5bfc18853c23a00bcc1749 /net/http
parent595c0ffc98abcad93010c94da8e99a87efce80c8 (diff)
downloadchromium_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/http')
-rw-r--r--net/http/http_network_layer.cc12
-rw-r--r--net/http/http_network_layer.h4
2 files changed, 15 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