summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 17:30:54 +0000
committerlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 17:30:54 +0000
commit12893c317ae3887de59727df0de45faae3f660e6 (patch)
tree9a2c5515c4fec605af1a5b073bfdb5aa46ced546 /chrome/browser/renderer_host
parent36955358355136978385ac8bb829807648c462e2 (diff)
downloadchromium_src-12893c317ae3887de59727df0de45faae3f660e6.zip
chromium_src-12893c317ae3887de59727df0de45faae3f660e6.tar.gz
chromium_src-12893c317ae3887de59727df0de45faae3f660e6.tar.bz2
Enable/Disable Spdy in benchmarking.
Test=none Bug=52624 Review URL: http://codereview.chromium.org/3169022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc12
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index 8a70211..e7985a0 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -84,6 +84,7 @@
#include "net/base/net_errors.h"
#include "net/disk_cache/disk_cache.h"
#include "net/http/http_cache.h"
+#include "net/http/http_network_layer.h"
#include "net/http/http_transaction_factory.h"
#include "net/url_request/url_request_context.h"
#include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h"
@@ -485,6 +486,7 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ClearCache, OnClearCache)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidGenerateCacheableMetadata,
OnCacheableMetadataAvailable)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_EnableSpdy, OnEnableSpdy)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetFileSize, OnGetFileSize)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetFileModificationTime,
OnGetFileModificationTime)
@@ -1368,6 +1370,16 @@ void ResourceMessageFilter::OnCacheableMetadataAvailable(
url, base::Time::FromDoubleT(expected_response_time), buf, data.size());
}
+// TODO(lzheng): This only enables spdy over ssl. Enable spdy for http
+// when needed.
+void ResourceMessageFilter::OnEnableSpdy(bool enable) {
+ if (enable) {
+ net::HttpNetworkLayer::EnableSpdy("npn");
+ } else {
+ net::HttpNetworkLayer::EnableSpdy("npn-http");
+ }
+}
+
void ResourceMessageFilter::OnGetFileSize(const FilePath& path,
IPC::Message* reply_msg) {
// Get file size only when the child process has been granted permission to
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index cc1a15f..ebd94a6 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -335,6 +335,7 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
void OnCacheableMetadataAvailable(const GURL& url,
double expected_response_time,
const std::vector<char>& data);
+ void OnEnableSpdy(bool enable);
void OnGetFileSize(const FilePath& path, IPC::Message* reply_msg);
void OnGetFileModificationTime(const FilePath& path, IPC::Message* reply_msg);
void OnGetFileInfoOnFileThread(const FilePath& path,