Index: content/browser/appcache/chrome_appcache_service.cc |
=================================================================== |
--- content/browser/appcache/chrome_appcache_service.cc (revision 156155) |
+++ content/browser/appcache/chrome_appcache_service.cc (working copy) |
@@ -9,6 +9,8 @@ |
#include "content/public/browser/content_browser_client.h" |
#include "content/public/browser/resource_context.h" |
#include "net/base/net_errors.h" |
+#include "net/url_request/url_request_context_getter.h" |
+#include "webkit/appcache/appcache_storage_impl.h" |
#include "webkit/quota/quota_manager.h" |
using content::BrowserThread; |
@@ -22,12 +24,14 @@ |
void ChromeAppCacheService::InitializeOnIOThread( |
const FilePath& cache_path, |
content::ResourceContext* resource_context, |
+ net::URLRequestContextGetter* request_context_getter, |
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
cache_path_ = cache_path; |
resource_context_ = resource_context; |
- set_request_context(resource_context->GetRequestContext()); |
+ if (request_context_getter) |
+ set_request_context(request_context_getter->GetURLRequestContext()); |
// Init our base class. |
Initialize( |
@@ -37,6 +41,9 @@ |
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); |
set_appcache_policy(this); |
set_special_storage_policy(special_storage_policy); |
+ |
+ if (!request_context()) |
+ static_cast<appcache::AppCacheStorageImpl*>(storage())->Disable(); |
} |
bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url, |