| 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 "webkit/tools/test_shell/simple_appcache_system.h" | 5 #include "webkit/tools/test_shell/simple_appcache_system.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 } | 379 } |
| 380 } | 380 } |
| 381 | 381 |
| 382 void SimpleAppCacheSystem::InitOnUIThread(const FilePath& cache_directory) { | 382 void SimpleAppCacheSystem::InitOnUIThread(const FilePath& cache_directory) { |
| 383 DCHECK(!ui_message_loop_); | 383 DCHECK(!ui_message_loop_); |
| 384 AppCacheThread::Init(DB_THREAD_ID, IO_THREAD_ID); | 384 AppCacheThread::Init(DB_THREAD_ID, IO_THREAD_ID); |
| 385 ui_message_loop_ = MessageLoop::current(); | 385 ui_message_loop_ = MessageLoop::current(); |
| 386 cache_directory_ = cache_directory; | 386 cache_directory_ = cache_directory; |
| 387 } | 387 } |
| 388 | 388 |
| 389 void SimpleAppCacheSystem::InitOnIOThread(URLRequestContext* request_context) { | 389 void SimpleAppCacheSystem::InitOnIOThread( |
| 390 net::URLRequestContext* request_context) { |
| 390 if (!is_initailized_on_ui_thread()) | 391 if (!is_initailized_on_ui_thread()) |
| 391 return; | 392 return; |
| 392 | 393 |
| 393 DCHECK(!io_message_loop_); | 394 DCHECK(!io_message_loop_); |
| 394 io_message_loop_ = MessageLoop::current(); | 395 io_message_loop_ = MessageLoop::current(); |
| 395 | 396 |
| 396 if (!db_thread_.IsRunning()) | 397 if (!db_thread_.IsRunning()) |
| 397 db_thread_.Start(); | 398 db_thread_.Start(); |
| 398 | 399 |
| 399 // Recreate and initialize per each IO thread. | 400 // Recreate and initialize per each IO thread. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 } | 446 } |
| 446 | 447 |
| 447 void SimpleAppCacheSystem::GetExtraResponseBits( | 448 void SimpleAppCacheSystem::GetExtraResponseBits( |
| 448 net::URLRequest* request, int64* cache_id, GURL* manifest_url) { | 449 net::URLRequest* request, int64* cache_id, GURL* manifest_url) { |
| 449 if (is_initialized()) { | 450 if (is_initialized()) { |
| 450 DCHECK(is_io_thread()); | 451 DCHECK(is_io_thread()); |
| 451 AppCacheInterceptor::GetExtraResponseInfo( | 452 AppCacheInterceptor::GetExtraResponseInfo( |
| 452 request, cache_id, manifest_url); | 453 request, cache_id, manifest_url); |
| 453 } | 454 } |
| 454 } | 455 } |
| OLD | NEW |