| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 if (system_->is_ui_thread()) { | 192 if (system_->is_ui_thread()) { |
| 193 system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 193 system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
| 194 this, &SimpleBackendProxy::UnregisterHost, host_id)); | 194 this, &SimpleBackendProxy::UnregisterHost, host_id)); |
| 195 } else if (system_->is_io_thread()) { | 195 } else if (system_->is_io_thread()) { |
| 196 system_->backend_impl_->UnregisterHost(host_id); | 196 system_->backend_impl_->UnregisterHost(host_id); |
| 197 } else { | 197 } else { |
| 198 NOTREACHED(); | 198 NOTREACHED(); |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 | 201 |
| 202 virtual void SetSpawningHostId(int host_id, int spawning_host_id) { |
| 203 if (system_->is_ui_thread()) { |
| 204 system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
| 205 this, &SimpleBackendProxy::SetSpawningHostId, |
| 206 host_id, spawning_host_id)); |
| 207 } else if (system_->is_io_thread()) { |
| 208 system_->backend_impl_->SetSpawningHostId(host_id, spawning_host_id); |
| 209 } else { |
| 210 NOTREACHED(); |
| 211 } |
| 212 } |
| 213 |
| 202 virtual void SelectCache(int host_id, | 214 virtual void SelectCache(int host_id, |
| 203 const GURL& document_url, | 215 const GURL& document_url, |
| 204 const int64 cache_document_was_loaded_from, | 216 const int64 cache_document_was_loaded_from, |
| 205 const GURL& manifest_url) { | 217 const GURL& manifest_url) { |
| 206 if (system_->is_ui_thread()) { | 218 if (system_->is_ui_thread()) { |
| 207 system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 219 system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
| 208 this, &SimpleBackendProxy::SelectCache, host_id, document_url, | 220 this, &SimpleBackendProxy::SelectCache, host_id, document_url, |
| 209 cache_document_was_loaded_from, manifest_url)); | 221 cache_document_was_loaded_from, manifest_url)); |
| 210 } else if (system_->is_io_thread()) { | 222 } else if (system_->is_io_thread()) { |
| 211 system_->backend_impl_->SelectCache(host_id, document_url, | 223 system_->backend_impl_->SelectCache(host_id, document_url, |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 } | 458 } |
| 447 | 459 |
| 448 void SimpleAppCacheSystem::GetExtraResponseBits( | 460 void SimpleAppCacheSystem::GetExtraResponseBits( |
| 449 net::URLRequest* request, int64* cache_id, GURL* manifest_url) { | 461 net::URLRequest* request, int64* cache_id, GURL* manifest_url) { |
| 450 if (is_initialized()) { | 462 if (is_initialized()) { |
| 451 DCHECK(is_io_thread()); | 463 DCHECK(is_io_thread()); |
| 452 AppCacheInterceptor::GetExtraResponseInfo( | 464 AppCacheInterceptor::GetExtraResponseInfo( |
| 453 request, cache_id, manifest_url); | 465 request, cache_id, manifest_url); |
| 454 } | 466 } |
| 455 } | 467 } |
| OLD | NEW |