| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/appcache/chrome_appcache_service.h" | 5 #include "chrome/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 "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
| 10 #include "chrome/browser/cookie_prompt_modal_dialog_delegate.h" | 10 #include "chrome/browser/cookie_prompt_modal_dialog_delegate.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // ---------------------------------------------------------------------------- | 46 // ---------------------------------------------------------------------------- |
| 47 | 47 |
| 48 ChromeAppCacheService::ChromeAppCacheService( | 48 ChromeAppCacheService::ChromeAppCacheService( |
| 49 const FilePath& profile_path, | 49 const FilePath& profile_path, |
| 50 ChromeURLRequestContext* request_context) { | 50 ChromeURLRequestContext* request_context) { |
| 51 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 51 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
| 52 DCHECK(request_context); | 52 DCHECK(request_context); |
| 53 | 53 |
| 54 if (!has_initialized_thread_ids) { | 54 if (!has_initialized_thread_ids) { |
| 55 has_initialized_thread_ids = true; | 55 has_initialized_thread_ids = true; |
| 56 appcache::AppCacheThread::Init(ChromeThread::DB, ChromeThread::IO, | 56 appcache::AppCacheThread::Init(ChromeThread::DB, ChromeThread::IO); |
| 57 NULL); // TODO(michaeln): cache_thread | |
| 58 } | 57 } |
| 59 | 58 |
| 60 host_contents_settings_map_ = request_context->host_content_settings_map(); | 59 host_contents_settings_map_ = request_context->host_content_settings_map(); |
| 61 registrar_.Add( | 60 registrar_.Add( |
| 62 this, NotificationType::PURGE_MEMORY, NotificationService::AllSources()); | 61 this, NotificationType::PURGE_MEMORY, NotificationService::AllSources()); |
| 63 | 62 |
| 64 // Init our base class. | 63 // Init our base class. |
| 65 Initialize(request_context->is_off_the_record() ? | 64 Initialize(request_context->is_off_the_record() ? |
| 66 FilePath() : profile_path.Append(chrome::kAppCacheDirname)); | 65 FilePath() : profile_path.Append(chrome::kAppCacheDirname), |
| 66 ChromeThread::GetMessageLoopProxyForThread(ChromeThread::CACHE)); |
| 67 set_request_context(request_context); | 67 set_request_context(request_context); |
| 68 set_appcache_policy(this); | 68 set_appcache_policy(this); |
| 69 } | 69 } |
| 70 | 70 |
| 71 ChromeAppCacheService::~ChromeAppCacheService() { | 71 ChromeAppCacheService::~ChromeAppCacheService() { |
| 72 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 72 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
| 73 } | 73 } |
| 74 | 74 |
| 75 // static | 75 // static |
| 76 void ChromeAppCacheService::ClearLocalState(const FilePath& profile_path) { | 76 void ChromeAppCacheService::ClearLocalState(const FilePath& profile_path) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 const tracked_objects::Location& from_here, | 169 const tracked_objects::Location& from_here, |
| 170 Task* task) { | 170 Task* task) { |
| 171 return ChromeThread::PostTask(ToChromeThreadID(id), from_here, task); | 171 return ChromeThread::PostTask(ToChromeThreadID(id), from_here, task); |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool AppCacheThread::CurrentlyOn(int id) { | 174 bool AppCacheThread::CurrentlyOn(int id) { |
| 175 return ChromeThread::CurrentlyOn(ToChromeThreadID(id)); | 175 return ChromeThread::CurrentlyOn(ToChromeThreadID(id)); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace appcache | 178 } // namespace appcache |
| OLD | NEW |