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 "webkit/support/simple_appcache_system.h" | 5 #include "webkit/support/simple_appcache_system.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 DCHECK(!io_message_loop_); | 403 DCHECK(!io_message_loop_); |
404 io_message_loop_ = base::MessageLoop::current(); | 404 io_message_loop_ = base::MessageLoop::current(); |
405 | 405 |
406 if (!db_thread_.IsRunning()) | 406 if (!db_thread_.IsRunning()) |
407 db_thread_.Start(); | 407 db_thread_.Start(); |
408 | 408 |
409 // Recreate and initialize per each IO thread. | 409 // Recreate and initialize per each IO thread. |
410 service_ = new appcache::AppCacheService(NULL); | 410 service_ = new appcache::AppCacheService(NULL); |
411 backend_impl_ = new appcache::AppCacheBackendImpl(); | 411 backend_impl_ = new appcache::AppCacheBackendImpl(); |
412 service_->Initialize(cache_directory_, | 412 service_->Initialize(cache_directory_, |
413 db_thread_.message_loop_proxy(), | 413 db_thread_.message_loop_proxy().get(), |
414 SimpleResourceLoaderBridge::GetCacheThread()); | 414 SimpleResourceLoaderBridge::GetCacheThread().get()); |
415 service_->set_request_context(request_context); | 415 service_->set_request_context(request_context); |
416 backend_impl_->Initialize(service_, frontend_proxy_.get(), kSingleProcessId); | 416 backend_impl_->Initialize(service_, frontend_proxy_.get(), kSingleProcessId); |
417 | 417 |
418 AppCacheInterceptor::EnsureRegistered(); | 418 AppCacheInterceptor::EnsureRegistered(); |
419 } | 419 } |
420 | 420 |
421 void SimpleAppCacheSystem::CleanupIOThread() { | 421 void SimpleAppCacheSystem::CleanupIOThread() { |
422 DCHECK(is_io_thread()); | 422 DCHECK(is_io_thread()); |
423 | 423 |
424 delete backend_impl_; | 424 delete backend_impl_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 } | 456 } |
457 | 457 |
458 void SimpleAppCacheSystem::GetExtraResponseBits( | 458 void SimpleAppCacheSystem::GetExtraResponseBits( |
459 net::URLRequest* request, int64* cache_id, GURL* manifest_url) { | 459 net::URLRequest* request, int64* cache_id, GURL* manifest_url) { |
460 if (is_initialized()) { | 460 if (is_initialized()) { |
461 DCHECK(is_io_thread()); | 461 DCHECK(is_io_thread()); |
462 AppCacheInterceptor::GetExtraResponseInfo( | 462 AppCacheInterceptor::GetExtraResponseInfo( |
463 request, cache_id, manifest_url); | 463 request, cache_id, manifest_url); |
464 } | 464 } |
465 } | 465 } |
OLD | NEW |