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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 info_ = NULL; | 375 info_ = NULL; |
376 cache_ = NULL; | 376 cache_ = NULL; |
377 group_ = NULL; | 377 group_ = NULL; |
378 range_response_info_.reset(); | 378 range_response_info_.reset(); |
379 net::URLRequestJob::Kill(); | 379 net::URLRequestJob::Kill(); |
380 weak_factory_.InvalidateWeakPtrs(); | 380 weak_factory_.InvalidateWeakPtrs(); |
381 } | 381 } |
382 } | 382 } |
383 | 383 |
384 net::LoadState AppCacheURLRequestJob::GetLoadState() const { | 384 net::LoadState AppCacheURLRequestJob::GetLoadState() const { |
| 385 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455952 is |
| 386 // fixed. |
| 387 tracked_objects::ScopedTracker tracking_profile( |
| 388 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 389 "455952 AppCacheURLRequestJob::GetLoadState")); |
385 if (!has_been_started()) | 390 if (!has_been_started()) |
386 return net::LOAD_STATE_IDLE; | 391 return net::LOAD_STATE_IDLE; |
387 if (!has_delivery_orders()) | 392 if (!has_delivery_orders()) |
388 return net::LOAD_STATE_WAITING_FOR_APPCACHE; | 393 return net::LOAD_STATE_WAITING_FOR_APPCACHE; |
389 if (delivery_type_ != APPCACHED_DELIVERY) | 394 if (delivery_type_ != APPCACHED_DELIVERY) |
390 return net::LOAD_STATE_IDLE; | 395 return net::LOAD_STATE_IDLE; |
391 if (!info_.get()) | 396 if (!info_.get()) |
392 return net::LOAD_STATE_WAITING_FOR_APPCACHE; | 397 return net::LOAD_STATE_WAITING_FOR_APPCACHE; |
393 if (reader_.get() && reader_->IsReadPending()) | 398 if (reader_.get() && reader_->IsReadPending()) |
394 return net::LOAD_STATE_READING_RESPONSE; | 399 return net::LOAD_STATE_READING_RESPONSE; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 return; | 451 return; |
447 } | 452 } |
448 | 453 |
449 // If multiple ranges are requested, we play dumb and | 454 // If multiple ranges are requested, we play dumb and |
450 // return the entire response with 200 OK. | 455 // return the entire response with 200 OK. |
451 if (ranges.size() == 1U) | 456 if (ranges.size() == 1U) |
452 range_requested_ = ranges[0]; | 457 range_requested_ = ranges[0]; |
453 } | 458 } |
454 | 459 |
455 } // namespace content | 460 } // namespace content |
OLD | NEW |