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 "chrome/common/net/url_fetcher.h" | 5 #include "chrome/common/net/url_fetcher.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 request_->set_method("HEAD"); | 355 request_->set_method("HEAD"); |
356 break; | 356 break; |
357 | 357 |
358 default: | 358 default: |
359 NOTREACHED(); | 359 NOTREACHED(); |
360 } | 360 } |
361 | 361 |
362 if (!extra_request_headers_.IsEmpty()) | 362 if (!extra_request_headers_.IsEmpty()) |
363 request_->SetExtraRequestHeaders(extra_request_headers_); | 363 request_->SetExtraRequestHeaders(extra_request_headers_); |
364 | 364 |
| 365 // There might be data left over from a previous request attempt. |
| 366 data_.clear(); |
| 367 |
365 request_->Start(); | 368 request_->Start(); |
366 } | 369 } |
367 | 370 |
368 void URLFetcher::Core::StartURLRequestWhenAppropriate() { | 371 void URLFetcher::Core::StartURLRequestWhenAppropriate() { |
369 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); | 372 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); |
370 | 373 |
371 if (was_cancelled_) | 374 if (was_cancelled_) |
372 return; | 375 return; |
373 | 376 |
374 if (original_url_throttler_entry_ == NULL) { | 377 if (original_url_throttler_entry_ == NULL) { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 } | 519 } |
517 | 520 |
518 // static | 521 // static |
519 void URLFetcher::CancelAll() { | 522 void URLFetcher::CancelAll() { |
520 Core::CancelAll(); | 523 Core::CancelAll(); |
521 } | 524 } |
522 | 525 |
523 URLFetcher::Delegate* URLFetcher::delegate() const { | 526 URLFetcher::Delegate* URLFetcher::delegate() const { |
524 return core_->delegate(); | 527 return core_->delegate(); |
525 } | 528 } |
OLD | NEW |