| 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/browser/content_browser_client.h" | 9 #include "content/browser/content_browser_client.h" |
| 10 #include "content/common/notification_service.h" | 10 #include "content/common/notification_service.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 clear_local_state)); | 78 clear_local_state)); |
| 79 return; | 79 return; |
| 80 } | 80 } |
| 81 clear_local_state_on_exit_ = clear_local_state; | 81 clear_local_state_on_exit_ = clear_local_state; |
| 82 } | 82 } |
| 83 | 83 |
| 84 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url) { | 84 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url) { |
| 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 86 // We don't prompt for read access. | 86 // We don't prompt for read access. |
| 87 return content::GetContentClient()->browser()->AllowAppCache( | 87 return content::GetContentClient()->browser()->AllowAppCache( |
| 88 manifest_url, resource_context_); | 88 manifest_url, *resource_context_); |
| 89 } | 89 } |
| 90 | 90 |
| 91 int ChromeAppCacheService::CanCreateAppCache( | 91 int ChromeAppCacheService::CanCreateAppCache( |
| 92 const GURL& manifest_url, net::CompletionCallback* callback) { | 92 const GURL& manifest_url, net::CompletionCallback* callback) { |
| 93 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 93 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 94 return content::GetContentClient()->browser()->AllowAppCache( | 94 return content::GetContentClient()->browser()->AllowAppCache( |
| 95 manifest_url, resource_context_) ? net::OK : net::ERR_ACCESS_DENIED; | 95 manifest_url, *resource_context_) ? net::OK : net::ERR_ACCESS_DENIED; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void ChromeAppCacheService::Observe(NotificationType type, | 98 void ChromeAppCacheService::Observe(NotificationType type, |
| 99 const NotificationSource& source, | 99 const NotificationSource& source, |
| 100 const NotificationDetails& details) { | 100 const NotificationDetails& details) { |
| 101 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 101 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 102 DCHECK(type == NotificationType::PURGE_MEMORY); | 102 DCHECK(type == NotificationType::PURGE_MEMORY); |
| 103 PurgeMemory(); | 103 PurgeMemory(); |
| 104 } | 104 } |
| 105 | 105 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 120 const tracked_objects::Location& from_here, | 120 const tracked_objects::Location& from_here, |
| 121 Task* task) { | 121 Task* task) { |
| 122 return BrowserThread::PostTask(ToBrowserThreadID(id), from_here, task); | 122 return BrowserThread::PostTask(ToBrowserThreadID(id), from_here, task); |
| 123 } | 123 } |
| 124 | 124 |
| 125 bool AppCacheThread::CurrentlyOn(int id) { | 125 bool AppCacheThread::CurrentlyOn(int id) { |
| 126 return BrowserThread::CurrentlyOn(ToBrowserThreadID(id)); | 126 return BrowserThread::CurrentlyOn(ToBrowserThreadID(id)); |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace appcache | 129 } // namespace appcache |
| OLD | NEW |