| OLD | NEW |
| 1 // Copyright (c) 2009 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/appcache/appcache_update_job.h" | 5 #include "webkit/appcache/appcache_update_job.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| 11 #include "net/base/load_flags.h" | 11 #include "net/base/load_flags.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 OnPolicyCheckComplete(rv); | 216 OnPolicyCheckComplete(rv); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void AppCacheUpdateJob::OnPolicyCheckComplete(int rv) { | 219 void AppCacheUpdateJob::OnPolicyCheckComplete(int rv) { |
| 220 policy_callback_->Release(); // Balanced in CheckPolicy. | 220 policy_callback_->Release(); // Balanced in CheckPolicy. |
| 221 if (rv == net::OK) { | 221 if (rv == net::OK) { |
| 222 FetchManifest(true); | 222 FetchManifest(true); |
| 223 return; | 223 return; |
| 224 } | 224 } |
| 225 | 225 |
| 226 group_->NotifyContentBlocked(); |
| 227 |
| 226 MessageLoop::current()->PostTask(FROM_HERE, | 228 MessageLoop::current()->PostTask(FROM_HERE, |
| 227 method_factory_.NewRunnableMethod( | 229 method_factory_.NewRunnableMethod( |
| 228 &AppCacheUpdateJob::HandleCacheFailure)); | 230 &AppCacheUpdateJob::HandleCacheFailure)); |
| 229 } | 231 } |
| 230 | 232 |
| 231 void AppCacheUpdateJob::HandleCacheFailure() { | 233 void AppCacheUpdateJob::HandleCacheFailure() { |
| 232 // TODO(michaeln): For now this is only invoked from one point | 234 // TODO(michaeln): For now this is only invoked from one point |
| 233 // of failure. Overtime, attempt the migrate the various places | 235 // of failure. Overtime, attempt the migrate the various places |
| 234 // where we can detect a failure condition to use this same | 236 // where we can detect a failure condition to use this same |
| 235 // method to enter the cache_failure state. | 237 // method to enter the cache_failure state. |
| (...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 | 1315 |
| 1314 // Break the connection with the group so the group cannot call delete | 1316 // Break the connection with the group so the group cannot call delete |
| 1315 // on this object after we've posted a task to delete ourselves. | 1317 // on this object after we've posted a task to delete ourselves. |
| 1316 group_->SetUpdateStatus(AppCacheGroup::IDLE); | 1318 group_->SetUpdateStatus(AppCacheGroup::IDLE); |
| 1317 group_ = NULL; | 1319 group_ = NULL; |
| 1318 | 1320 |
| 1319 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 1321 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 1320 } | 1322 } |
| 1321 | 1323 |
| 1322 } // namespace appcache | 1324 } // namespace appcache |
| OLD | NEW |