| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/appcache/appcache_service_impl.h" | 5 #include "content/browser/appcache/appcache_service_impl.h" |
| 6 | 6 |
| 7 #include <functional> | 7 #include <functional> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } else { | 324 } else { |
| 325 AppCacheHistograms::CountCheckResponseResult( | 325 AppCacheHistograms::CountCheckResponseResult( |
| 326 AppCacheHistograms::RESPONSE_OUT_OF_DATE); | 326 AppCacheHistograms::RESPONSE_OUT_OF_DATE); |
| 327 } | 327 } |
| 328 delete this; | 328 delete this; |
| 329 return; | 329 return; |
| 330 } | 330 } |
| 331 | 331 |
| 332 // Verify that we can read the response info and data. | 332 // Verify that we can read the response info and data. |
| 333 expected_total_size_ = entry->response_size(); | 333 expected_total_size_ = entry->response_size(); |
| 334 response_reader_.reset(service_->storage()->CreateResponseReader( | 334 response_reader_.reset( |
| 335 manifest_url_, group->group_id(), response_id_)); | 335 service_->storage()->CreateResponseReader(manifest_url_, response_id_)); |
| 336 info_buffer_ = new HttpResponseInfoIOBuffer(); | 336 info_buffer_ = new HttpResponseInfoIOBuffer(); |
| 337 response_reader_->ReadInfo( | 337 response_reader_->ReadInfo( |
| 338 info_buffer_.get(), | 338 info_buffer_.get(), |
| 339 base::Bind(&CheckResponseHelper::OnReadInfoComplete, | 339 base::Bind(&CheckResponseHelper::OnReadInfoComplete, |
| 340 base::Unretained(this))); | 340 base::Unretained(this))); |
| 341 } | 341 } |
| 342 | 342 |
| 343 void AppCacheServiceImpl::CheckResponseHelper::OnReadInfoComplete(int result) { | 343 void AppCacheServiceImpl::CheckResponseHelper::OnReadInfoComplete(int result) { |
| 344 if (result < 0) { | 344 if (result < 0) { |
| 345 AppCacheHistograms::CountCheckResponseResult( | 345 AppCacheHistograms::CountCheckResponseResult( |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 backends_.insert( | 517 backends_.insert( |
| 518 BackendMap::value_type(backend_impl->process_id(), backend_impl)); | 518 BackendMap::value_type(backend_impl->process_id(), backend_impl)); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void AppCacheServiceImpl::UnregisterBackend( | 521 void AppCacheServiceImpl::UnregisterBackend( |
| 522 AppCacheBackendImpl* backend_impl) { | 522 AppCacheBackendImpl* backend_impl) { |
| 523 backends_.erase(backend_impl->process_id()); | 523 backends_.erase(backend_impl->process_id()); |
| 524 } | 524 } |
| 525 | 525 |
| 526 } // namespace content | 526 } // namespace content |
| OLD | NEW |