| 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/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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 // SimpleAppCacheSystem -------------------------------------------------------- | 355 // SimpleAppCacheSystem -------------------------------------------------------- |
| 356 | 356 |
| 357 // This class only works for a single process browser. | 357 // This class only works for a single process browser. |
| 358 static const int kSingleProcessId = 1; | 358 static const int kSingleProcessId = 1; |
| 359 | 359 |
| 360 // A not so thread safe singleton, but should work for test_shell. | 360 // A not so thread safe singleton, but should work for test_shell. |
| 361 SimpleAppCacheSystem* SimpleAppCacheSystem::instance_ = NULL; | 361 SimpleAppCacheSystem* SimpleAppCacheSystem::instance_ = NULL; |
| 362 | 362 |
| 363 SimpleAppCacheSystem::SimpleAppCacheSystem() | 363 SimpleAppCacheSystem::SimpleAppCacheSystem() |
| 364 : io_message_loop_(NULL), ui_message_loop_(NULL), | 364 : io_message_loop_(NULL), ui_message_loop_(NULL), |
| 365 ALLOW_THIS_IN_INITIALIZER_LIST( | 365 backend_proxy_(new SimpleBackendProxy(this)), |
| 366 backend_proxy_(new SimpleBackendProxy(this))), | 366 frontend_proxy_(new SimpleFrontendProxy(this)), |
| 367 ALLOW_THIS_IN_INITIALIZER_LIST( | |
| 368 frontend_proxy_(new SimpleFrontendProxy(this))), | |
| 369 backend_impl_(NULL), service_(NULL), db_thread_("AppCacheDBThread") { | 367 backend_impl_(NULL), service_(NULL), db_thread_("AppCacheDBThread") { |
| 370 DCHECK(!instance_); | 368 DCHECK(!instance_); |
| 371 instance_ = this; | 369 instance_ = this; |
| 372 } | 370 } |
| 373 | 371 |
| 374 static void SignalEvent(base::WaitableEvent* event) { | 372 static void SignalEvent(base::WaitableEvent* event) { |
| 375 event->Signal(); | 373 event->Signal(); |
| 376 } | 374 } |
| 377 | 375 |
| 378 SimpleAppCacheSystem::~SimpleAppCacheSystem() { | 376 SimpleAppCacheSystem::~SimpleAppCacheSystem() { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 456 } |
| 459 | 457 |
| 460 void SimpleAppCacheSystem::GetExtraResponseBits( | 458 void SimpleAppCacheSystem::GetExtraResponseBits( |
| 461 net::URLRequest* request, int64* cache_id, GURL* manifest_url) { | 459 net::URLRequest* request, int64* cache_id, GURL* manifest_url) { |
| 462 if (is_initialized()) { | 460 if (is_initialized()) { |
| 463 DCHECK(is_io_thread()); | 461 DCHECK(is_io_thread()); |
| 464 AppCacheInterceptor::GetExtraResponseInfo( | 462 AppCacheInterceptor::GetExtraResponseInfo( |
| 465 request, cache_id, manifest_url); | 463 request, cache_id, manifest_url); |
| 466 } | 464 } |
| 467 } | 465 } |
| OLD | NEW |