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/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
10 #include "chrome/browser/net/chrome_url_request_context.h" | 10 #include "chrome/browser/net/chrome_url_request_context.h" |
11 #include "chrome/common/chrome_constants.h" | 11 #include "chrome/common/chrome_constants.h" |
12 #include "chrome/common/notification_service.h" | 12 #include "chrome/common/notification_service.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
14 #include "webkit/appcache/appcache_thread.h" | 14 #include "webkit/appcache/appcache_thread.h" |
15 | 15 |
16 static bool has_initialized_thread_ids; | 16 static bool has_initialized_thread_ids; |
17 | 17 |
18 ChromeAppCacheService::ChromeAppCacheService( | 18 ChromeAppCacheService::ChromeAppCacheService( |
19 const FilePath& profile_path, | 19 const FilePath& profile_path, |
20 ChromeURLRequestContext* request_context) { | 20 ChromeURLRequestContext* request_context) { |
21 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 21 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
22 DCHECK(request_context); | 22 DCHECK(request_context); |
23 | 23 |
24 if (!has_initialized_thread_ids) { | 24 if (!has_initialized_thread_ids) { |
25 has_initialized_thread_ids = true; | 25 has_initialized_thread_ids = true; |
26 appcache::AppCacheThread::InitIDs(ChromeThread::DB, ChromeThread::IO); | 26 appcache::AppCacheThread::Init(ChromeThread::DB, ChromeThread::IO, |
| 27 NULL); // TODO(michaeln): cache_thread |
27 } | 28 } |
28 | 29 |
29 host_contents_settings_map_ = request_context->host_content_settings_map(); | 30 host_contents_settings_map_ = request_context->host_content_settings_map(); |
30 registrar_.Add( | 31 registrar_.Add( |
31 this, NotificationType::PURGE_MEMORY, NotificationService::AllSources()); | 32 this, NotificationType::PURGE_MEMORY, NotificationService::AllSources()); |
32 | 33 |
33 // Init our base class. | 34 // Init our base class. |
34 Initialize(request_context->is_off_the_record() ? | 35 Initialize(request_context->is_off_the_record() ? |
35 FilePath() : profile_path.Append(chrome::kAppCacheDirname)); | 36 FilePath() : profile_path.Append(chrome::kAppCacheDirname)); |
36 set_request_context(request_context); | 37 set_request_context(request_context); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 const tracked_objects::Location& from_here, | 89 const tracked_objects::Location& from_here, |
89 Task* task) { | 90 Task* task) { |
90 return ChromeThread::PostTask(ToChromeThreadID(id), from_here, task); | 91 return ChromeThread::PostTask(ToChromeThreadID(id), from_here, task); |
91 } | 92 } |
92 | 93 |
93 bool AppCacheThread::CurrentlyOn(int id) { | 94 bool AppCacheThread::CurrentlyOn(int id) { |
94 return ChromeThread::CurrentlyOn(ToChromeThreadID(id)); | 95 return ChromeThread::CurrentlyOn(ToChromeThreadID(id)); |
95 } | 96 } |
96 | 97 |
97 } // namespace appcache | 98 } // namespace appcache |
OLD | NEW |