| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/appcache/chrome_appcache_service.h" | 5 #include "content/browser/appcache/chrome_appcache_service.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "content/public/browser/content_browser_client.h" | 9 #include "content/public/browser/content_browser_client.h" |
| 10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { | 26 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { |
| 27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 28 | 28 |
| 29 cache_path_ = cache_path; | 29 cache_path_ = cache_path; |
| 30 resource_context_ = resource_context; | 30 resource_context_ = resource_context; |
| 31 registrar_.Add( | 31 registrar_.Add( |
| 32 this, content::NOTIFICATION_PURGE_MEMORY, | 32 this, content::NOTIFICATION_PURGE_MEMORY, |
| 33 content::NotificationService::AllSources()); | 33 content::NotificationService::AllSources()); |
| 34 | 34 |
| 35 // Init our base class. | 35 // Init our base class. |
| 36 Initialize(cache_path_, | 36 Initialize( |
| 37 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), | 37 cache_path_, |
| 38 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); | 38 BrowserThread::GetMessageLoopProxyForThread( |
| 39 BrowserThread::FILE_USER_BLOCKING), |
| 40 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); |
| 39 set_appcache_policy(this); | 41 set_appcache_policy(this); |
| 40 set_special_storage_policy(special_storage_policy); | 42 set_special_storage_policy(special_storage_policy); |
| 41 } | 43 } |
| 42 | 44 |
| 43 ChromeAppCacheService::~ChromeAppCacheService() { | 45 ChromeAppCacheService::~ChromeAppCacheService() { |
| 44 } | 46 } |
| 45 | 47 |
| 46 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url, | 48 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url, |
| 47 const GURL& first_party) { | 49 const GURL& first_party) { |
| 48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 50 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 59 } | 61 } |
| 60 | 62 |
| 61 void ChromeAppCacheService::Observe( | 63 void ChromeAppCacheService::Observe( |
| 62 int type, | 64 int type, |
| 63 const content::NotificationSource& source, | 65 const content::NotificationSource& source, |
| 64 const content::NotificationDetails& details) { | 66 const content::NotificationDetails& details) { |
| 65 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 67 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 66 DCHECK(type == content::NOTIFICATION_PURGE_MEMORY); | 68 DCHECK(type == content::NOTIFICATION_PURGE_MEMORY); |
| 67 PurgeMemory(); | 69 PurgeMemory(); |
| 68 } | 70 } |
| OLD | NEW |