| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_url_request_job.h" | 5 #include "content/browser/appcache/appcache_url_request_job.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 return false; | 410 return false; |
| 411 return http_info()->headers->GetCharset(charset); | 411 return http_info()->headers->GetCharset(charset); |
| 412 } | 412 } |
| 413 | 413 |
| 414 void AppCacheURLRequestJob::GetResponseInfo(net::HttpResponseInfo* info) { | 414 void AppCacheURLRequestJob::GetResponseInfo(net::HttpResponseInfo* info) { |
| 415 if (!http_info()) | 415 if (!http_info()) |
| 416 return; | 416 return; |
| 417 *info = *http_info(); | 417 *info = *http_info(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 int AppCacheURLRequestJob::GetResponseCode() const { | |
| 421 if (!http_info()) | |
| 422 return -1; | |
| 423 return http_info()->headers->response_code(); | |
| 424 } | |
| 425 | |
| 426 int AppCacheURLRequestJob::ReadRawData(net::IOBuffer* buf, int buf_size) { | 420 int AppCacheURLRequestJob::ReadRawData(net::IOBuffer* buf, int buf_size) { |
| 427 DCHECK(is_delivering_appcache_response()); | 421 DCHECK(is_delivering_appcache_response()); |
| 428 DCHECK_NE(buf_size, 0); | 422 DCHECK_NE(buf_size, 0); |
| 429 DCHECK(!reader_->IsReadPending()); | 423 DCHECK(!reader_->IsReadPending()); |
| 430 reader_->ReadData(buf, buf_size, | 424 reader_->ReadData(buf, buf_size, |
| 431 base::Bind(&AppCacheURLRequestJob::OnReadComplete, | 425 base::Bind(&AppCacheURLRequestJob::OnReadComplete, |
| 432 base::Unretained(this))); | 426 base::Unretained(this))); |
| 433 return net::ERR_IO_PENDING; | 427 return net::ERR_IO_PENDING; |
| 434 } | 428 } |
| 435 | 429 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 453 if (ranges.size() == 1U) | 447 if (ranges.size() == 1U) |
| 454 range_requested_ = ranges[0]; | 448 range_requested_ = ranges[0]; |
| 455 } | 449 } |
| 456 | 450 |
| 457 void AppCacheURLRequestJob::NotifyRestartRequired() { | 451 void AppCacheURLRequestJob::NotifyRestartRequired() { |
| 458 on_prepare_to_restart_callback_.Run(); | 452 on_prepare_to_restart_callback_.Run(); |
| 459 URLRequestJob::NotifyRestartRequired(); | 453 URLRequestJob::NotifyRestartRequired(); |
| 460 } | 454 } |
| 461 | 455 |
| 462 } // namespace content | 456 } // namespace content |
| OLD | NEW |