From 21f659de19e3ea874a0958372a311746a0e764c2 Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Mon, 24 Aug 2009 17:59:31 +0000 Subject: Http cache: Enable experimental support for byte range requests. Requires --enable-byte-range-support BUG=12258 TEST=covered by unit tests. Review URL: http://codereview.chromium.org/173231 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24113 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/net/chrome_url_request_context.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'chrome/browser/net') diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index 5bb921b..da77fcf 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -125,6 +125,9 @@ ChromeURLRequestContext* ChromeURLRequestContext::CreateOriginal( context->ssl_config_service_, disk_cache_path.ToWStringHack(), cache_size); + if (command_line.HasSwitch(switches::kEnableByteRangeSupport)) + cache->set_enable_range_support(true); + bool record_mode = chrome::kRecordModeEnabled && command_line.HasSwitch(switches::kRecordMode); bool playback_mode = command_line.HasSwitch(switches::kPlaybackMode); @@ -207,10 +210,15 @@ ChromeURLRequestContext* ChromeURLRequestContext::CreateOffTheRecord( context->proxy_service_ = profile->GetOriginalProfile()->GetRequestContext()->proxy_service(); - context->http_transaction_factory_ = + net::HttpCache* cache = new net::HttpCache(context->host_resolver_, context->proxy_service_, context->ssl_config_service_, 0); context->cookie_store_ = new net::CookieMonster; + context->http_transaction_factory_ = cache; + + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableByteRangeSupport)) + cache->set_enable_range_support(true); // The kWininetFtp switch is Windows specific because we have two FTP // implementations on Windows. @@ -279,6 +287,10 @@ ChromeURLRequestContext* ChromeURLRequestContext::CreateRequestContextForMedia( disk_cache_path.ToWStringHack(), cache_size); } + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableByteRangeSupport)) + cache->set_enable_range_support(true); + cache->set_type(net::MEDIA_CACHE); context->http_transaction_factory_ = cache; return context; -- cgit v1.1