| 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/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.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 25 matching lines...) Expand all Loading... |
| 36 // TODO(ajwong): TestProfile is difficult to work with. The | 36 // TODO(ajwong): TestProfile is difficult to work with. The |
| 37 // SafeBrowsing tests require that GetRequestContext return NULL | 37 // SafeBrowsing tests require that GetRequestContext return NULL |
| 38 // 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. |
| 39 if (request_context_getter) | 39 if (request_context_getter) |
| 40 set_request_context(request_context_getter->GetURLRequestContext()); | 40 set_request_context(request_context_getter->GetURLRequestContext()); |
| 41 | 41 |
| 42 // Init our base class. | 42 // Init our base class. |
| 43 Initialize( | 43 Initialize( |
| 44 cache_path_, | 44 cache_path_, |
| 45 BrowserThread::GetMessageLoopProxyForThread( | 45 BrowserThread::GetMessageLoopProxyForThread( |
| 46 BrowserThread::FILE_USER_BLOCKING), | 46 BrowserThread::FILE_USER_BLOCKING) |
| 47 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); | 47 .get(), |
| 48 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE).get()); |
| 48 set_appcache_policy(this); | 49 set_appcache_policy(this); |
| 49 set_special_storage_policy(special_storage_policy.get()); | 50 set_special_storage_policy(special_storage_policy.get()); |
| 50 } | 51 } |
| 51 | 52 |
| 52 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url, | 53 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url, |
| 53 const GURL& first_party) { | 54 const GURL& first_party) { |
| 54 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 55 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 55 // We don't prompt for read access. | 56 // We don't prompt for read access. |
| 56 return GetContentClient()->browser()->AllowAppCache( | 57 return GetContentClient()->browser()->AllowAppCache( |
| 57 manifest_url, first_party, resource_context_); | 58 manifest_url, first_party, resource_context_); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 69 void ChromeAppCacheService::DeleteOnCorrectThread() const { | 70 void ChromeAppCacheService::DeleteOnCorrectThread() const { |
| 70 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) && | 71 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) && |
| 71 !BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 72 !BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| 72 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 73 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
| 73 return; | 74 return; |
| 74 } | 75 } |
| 75 delete this; | 76 delete this; |
| 76 } | 77 } |
| 77 | 78 |
| 78 } // namespace content | 79 } // namespace content |
| OLD | NEW |