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/content_browser_client.h" | 9 #include "content/public/browser/content_browser_client.h" |
10 #include "content/public/browser/resource_context.h" | 10 #include "content/public/browser/resource_context.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 const FilePath& cache_path, | 25 const FilePath& cache_path, |
26 content::ResourceContext* resource_context, | 26 content::ResourceContext* resource_context, |
27 net::URLRequestContextGetter* request_context_getter, | 27 net::URLRequestContextGetter* request_context_getter, |
28 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { | 28 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { |
29 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 29 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
30 | 30 |
31 cache_path_ = cache_path; | 31 cache_path_ = cache_path; |
32 resource_context_ = resource_context; | 32 resource_context_ = resource_context; |
33 | 33 |
34 // The |request_context_getter| can be NULL in some unit tests. | 34 // The |request_context_getter| can be NULL in some unit tests. |
35 // TODO(awong): TestProfile is difficult to work with. The | 35 // |
| 36 // TODO(ajwong): TestProfile is difficult to work with. The |
36 // SafeBrowsing tests require that GetRequestContext return NULL | 37 // SafeBrowsing tests require that GetRequestContext return NULL |
37 // so we can't depend on having a non-NULL value here. See crbug/149783. | 38 // so we can't depend on having a non-NULL value here. See crbug/149783. |
38 if (request_context_getter) | 39 if (request_context_getter) |
39 set_request_context(request_context_getter->GetURLRequestContext()); | 40 set_request_context(request_context_getter->GetURLRequestContext()); |
40 | 41 |
41 // Init our base class. | 42 // Init our base class. |
42 Initialize( | 43 Initialize( |
43 cache_path_, | 44 cache_path_, |
44 BrowserThread::GetMessageLoopProxyForThread( | 45 BrowserThread::GetMessageLoopProxyForThread( |
45 BrowserThread::FILE_USER_BLOCKING), | 46 BrowserThread::FILE_USER_BLOCKING), |
(...skipping 20 matching lines...) Expand all Loading... |
66 ChromeAppCacheService::~ChromeAppCacheService() {} | 67 ChromeAppCacheService::~ChromeAppCacheService() {} |
67 | 68 |
68 void ChromeAppCacheService::DeleteOnCorrectThread() const { | 69 void ChromeAppCacheService::DeleteOnCorrectThread() const { |
69 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) && | 70 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) && |
70 !BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 71 !BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
71 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 72 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
72 return; | 73 return; |
73 } | 74 } |
74 delete this; | 75 delete this; |
75 } | 76 } |
OLD | NEW |