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

Unified Diff: webkit/tools/test_shell/simple_appcache_system.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 | « webkit/tools/test_shell/simple_appcache_system.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/simple_appcache_system.cc
===================================================================
--- webkit/tools/test_shell/simple_appcache_system.cc (revision 100467)
+++ webkit/tools/test_shell/simple_appcache_system.cc (working copy)
@@ -19,35 +19,7 @@
using appcache::WebApplicationCacheHostImpl;
using appcache::AppCacheBackendImpl;
using appcache::AppCacheInterceptor;
-using appcache::AppCacheThread;
-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) {
- if (SimpleAppCacheSystem::thread_provider()) {
- return SimpleAppCacheSystem::thread_provider()->PostTask(
- id, from_here, task);
- }
- scoped_ptr<Task> task_ptr(task);
- MessageLoop* loop = SimpleAppCacheSystem::GetMessageLoop(id);
- if (loop)
- loop->PostTask(from_here, task_ptr.release());
- return loop ? true : false;
-}
-
-bool AppCacheThread::CurrentlyOn(int id) {
- if (SimpleAppCacheSystem::thread_provider())
- return SimpleAppCacheSystem::thread_provider()->CurrentlyOn(id);
- return MessageLoop::current() == SimpleAppCacheSystem::GetMessageLoop(id);
-}
-
-} // namespace appcache
-
// SimpleFrontendProxy --------------------------------------------------------
// Proxies method calls from the backend IO thread to the frontend UI thread.
@@ -366,8 +338,7 @@
backend_proxy_(new SimpleBackendProxy(this))),
ALLOW_THIS_IN_INITIALIZER_LIST(
frontend_proxy_(new SimpleFrontendProxy(this))),
- backend_impl_(NULL), service_(NULL), db_thread_("AppCacheDBThread"),
- thread_provider_(NULL) {
+ backend_impl_(NULL), service_(NULL), db_thread_("AppCacheDBThread") {
DCHECK(!instance_);
instance_ = this;
}
@@ -393,7 +364,6 @@
void SimpleAppCacheSystem::InitOnUIThread(const FilePath& cache_directory) {
DCHECK(!ui_message_loop_);
- AppCacheThread::Init(DB_THREAD_ID, IO_THREAD_ID);
ui_message_loop_ = MessageLoop::current();
cache_directory_ = cache_directory;
}
@@ -413,6 +383,7 @@
service_ = new appcache::AppCacheService(NULL);
backend_impl_ = new appcache::AppCacheBackendImpl();
service_->Initialize(cache_directory_,
+ db_thread_.message_loop_proxy(),
SimpleResourceLoaderBridge::GetCacheThread());
service_->set_request_context(request_context);
backend_impl_->Initialize(service_, frontend_proxy_.get(), kSingleProcessId);
« no previous file with comments | « webkit/tools/test_shell/simple_appcache_system.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698