Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Unified Diff: content/browser/appcache/chrome_appcache_service.cc

Issue 7863009: Replace ancient crufty AppCacheThread with much improved MessageLoopProxy usage. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/appcache/appcache_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/appcache/chrome_appcache_service.cc
===================================================================
--- content/browser/appcache/chrome_appcache_service.cc (revision 100467)
+++ content/browser/appcache/chrome_appcache_service.cc (working copy)
@@ -9,13 +9,8 @@
#include "content/browser/content_browser_client.h"
#include "content/common/notification_service.h"
#include "net/base/net_errors.h"
-#include "webkit/appcache/appcache_thread.h"
#include "webkit/quota/quota_manager.h"
-static bool has_initialized_thread_ids;
-
-// ----------------------------------------------------------------------------
-
ChromeAppCacheService::ChromeAppCacheService(
quota::QuotaManagerProxy* quota_manager_proxy)
: AppCacheService(quota_manager_proxy),
@@ -28,11 +23,6 @@
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- if (!has_initialized_thread_ids) {
- has_initialized_thread_ids = true;
- appcache::AppCacheThread::Init(BrowserThread::DB, BrowserThread::IO);
- }
-
cache_path_ = cache_path;
resource_context_ = resource_context;
registrar_.Add(
@@ -41,6 +31,7 @@
// Init our base class.
Initialize(cache_path_,
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
set_appcache_policy(this);
set_special_storage_policy(special_storage_policy);
@@ -71,28 +62,3 @@
DCHECK(type == content::NOTIFICATION_PURGE_MEMORY);
PurgeMemory();
}
-
-// ----------------------------------------------------------------------------
-
-static BrowserThread::ID ToBrowserThreadID(int id) {
- DCHECK(has_initialized_thread_ids);
- DCHECK(id == BrowserThread::DB || id == BrowserThread::IO);
- return static_cast<BrowserThread::ID>(id);
-}
-
-namespace appcache {
-
-// An impl of AppCacheThread we need to provide to the appcache lib.
-
-bool AppCacheThread::PostTask(
- int id,
- const tracked_objects::Location& from_here,
- Task* task) {
- return BrowserThread::PostTask(ToBrowserThreadID(id), from_here, task);
-}
-
-bool AppCacheThread::CurrentlyOn(int id) {
- return BrowserThread::CurrentlyOn(ToBrowserThreadID(id));
-}
-
-} // namespace appcache
« no previous file with comments | « no previous file | webkit/appcache/appcache_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698