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 "base/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.h" |
9 #include "content/browser/appcache/appcache_storage_impl.h" | 9 #include "content/browser/appcache/appcache_storage_impl.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // The |request_context_getter| can be NULL in some unit tests. | 38 // The |request_context_getter| can be NULL in some unit tests. |
39 // | 39 // |
40 // TODO(ajwong): TestProfile is difficult to work with. The | 40 // TODO(ajwong): TestProfile is difficult to work with. The |
41 // SafeBrowsing tests require that GetRequestContext return NULL | 41 // SafeBrowsing tests require that GetRequestContext return NULL |
42 // so we can't depend on having a non-NULL value here. See crbug/149783. | 42 // so we can't depend on having a non-NULL value here. See crbug/149783. |
43 if (request_context_getter) | 43 if (request_context_getter) |
44 set_request_context(request_context_getter->GetURLRequestContext()); | 44 set_request_context(request_context_getter->GetURLRequestContext()); |
45 | 45 |
46 // Init our base class. | 46 // Init our base class. |
47 Initialize(cache_path_, BrowserThread::GetTaskRunnerForThread( | 47 Initialize(cache_path_, |
48 BrowserThread::FILE_USER_BLOCKING) | |
49 .get(), | |
50 BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE).get()); | 48 BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE).get()); |
51 set_appcache_policy(this); | 49 set_appcache_policy(this); |
52 set_special_storage_policy(special_storage_policy.get()); | 50 set_special_storage_policy(special_storage_policy.get()); |
53 } | 51 } |
54 | 52 |
55 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url, | 53 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url, |
56 const GURL& first_party) { | 54 const GURL& first_party) { |
57 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 55 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
58 // We don't prompt for read access. | 56 // We don't prompt for read access. |
59 return GetContentClient()->browser()->AllowAppCache( | 57 return GetContentClient()->browser()->AllowAppCache( |
(...skipping 15 matching lines...) Expand all Loading... |
75 return; | 73 return; |
76 } | 74 } |
77 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { | 75 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { |
78 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 76 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
79 return; | 77 return; |
80 } | 78 } |
81 // Better to leak than crash on shutdown. | 79 // Better to leak than crash on shutdown. |
82 } | 80 } |
83 | 81 |
84 } // namespace content | 82 } // namespace content |
OLD | NEW |