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 "net/url_request/test_url_fetcher_factory.h" | 5 #include "net/url_request/test_url_fetcher_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 id_(id), | 41 id_(id), |
42 original_url_(url), | 42 original_url_(url), |
43 delegate_(d), | 43 delegate_(d), |
44 delegate_for_tests_(NULL), | 44 delegate_for_tests_(NULL), |
45 did_receive_last_chunk_(false), | 45 did_receive_last_chunk_(false), |
46 fake_load_flags_(0), | 46 fake_load_flags_(0), |
47 fake_response_code_(-1), | 47 fake_response_code_(-1), |
48 fake_response_destination_(STRING), | 48 fake_response_destination_(STRING), |
49 fake_was_fetched_via_proxy_(false), | 49 fake_was_fetched_via_proxy_(false), |
50 fake_max_retries_(0) { | 50 fake_max_retries_(0) { |
| 51 CHECK(original_url_.is_valid()); |
51 } | 52 } |
52 | 53 |
53 TestURLFetcher::~TestURLFetcher() { | 54 TestURLFetcher::~TestURLFetcher() { |
54 if (delegate_for_tests_) | 55 if (delegate_for_tests_) |
55 delegate_for_tests_->OnRequestEnd(id_); | 56 delegate_for_tests_->OnRequestEnd(id_); |
56 if (owner_) | 57 if (owner_) |
57 owner_->RemoveFetcherFromMap(id_); | 58 owner_->RemoveFetcherFromMap(id_); |
58 } | 59 } |
59 | 60 |
60 void TestURLFetcher::SetUploadData(const std::string& upload_content_type, | 61 void TestURLFetcher::SetUploadData(const std::string& upload_content_type, |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 439 |
439 URLFetcher* URLFetcherImplFactory::CreateURLFetcher( | 440 URLFetcher* URLFetcherImplFactory::CreateURLFetcher( |
440 int id, | 441 int id, |
441 const GURL& url, | 442 const GURL& url, |
442 URLFetcher::RequestType request_type, | 443 URLFetcher::RequestType request_type, |
443 URLFetcherDelegate* d) { | 444 URLFetcherDelegate* d) { |
444 return new URLFetcherImpl(url, request_type, d); | 445 return new URLFetcherImpl(url, request_type, d); |
445 } | 446 } |
446 | 447 |
447 } // namespace net | 448 } // namespace net |
OLD | NEW |