| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "content/public/browser/content_browser_client.h" | 10 #include "content/public/browser/content_browser_client.h" |
| 11 #include "content/public/browser/resource_context.h" | 11 #include "content/public/browser/resource_context.h" |
| 12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 13 #include "net/url_request/url_request_context_getter.h" | 13 #include "net/url_request/url_request_context_getter.h" |
| 14 #include "webkit/appcache/appcache_storage_impl.h" | 14 #include "webkit/appcache/appcache_storage_impl.h" |
| 15 #include "webkit/quota/quota_manager.h" | 15 #include "webkit/quota/quota_manager.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 ChromeAppCacheService::ChromeAppCacheService( | 19 ChromeAppCacheService::ChromeAppCacheService( |
| 20 quota::QuotaManagerProxy* quota_manager_proxy) | 20 quota::QuotaManagerProxy* quota_manager_proxy) |
| 21 : AppCacheService(quota_manager_proxy), | 21 : AppCacheService(quota_manager_proxy), |
| 22 resource_context_(NULL) { | 22 resource_context_(NULL) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 void ChromeAppCacheService::InitializeOnIOThread( | 25 void ChromeAppCacheService::InitializeOnIOThread( |
| 26 const FilePath& cache_path, | 26 const base::FilePath& cache_path, |
| 27 ResourceContext* resource_context, | 27 ResourceContext* resource_context, |
| 28 net::URLRequestContextGetter* request_context_getter, | 28 net::URLRequestContextGetter* request_context_getter, |
| 29 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { | 29 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { |
| 30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 31 | 31 |
| 32 cache_path_ = cache_path; | 32 cache_path_ = cache_path; |
| 33 resource_context_ = resource_context; | 33 resource_context_ = resource_context; |
| 34 | 34 |
| 35 // The |request_context_getter| can be NULL in some unit tests. | 35 // The |request_context_getter| can be NULL in some unit tests. |
| 36 // | 36 // |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 void ChromeAppCacheService::DeleteOnCorrectThread() const { | 70 void ChromeAppCacheService::DeleteOnCorrectThread() const { |
| 71 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) && | 71 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) && |
| 72 !BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 72 !BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| 73 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 73 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 delete this; | 76 delete this; |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace content | 79 } // namespace content |
| OLD | NEW |