| 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 #ifndef NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ | 5 #ifndef NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ |
| 6 #define NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ | 6 #define NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 TestURLFetcherFactory(); | 234 TestURLFetcherFactory(); |
| 235 virtual ~TestURLFetcherFactory(); | 235 virtual ~TestURLFetcherFactory(); |
| 236 | 236 |
| 237 virtual URLFetcher* CreateURLFetcher( | 237 virtual URLFetcher* CreateURLFetcher( |
| 238 int id, | 238 int id, |
| 239 const GURL& url, | 239 const GURL& url, |
| 240 URLFetcher::RequestType request_type, | 240 URLFetcher::RequestType request_type, |
| 241 URLFetcherDelegate* d) OVERRIDE; | 241 URLFetcherDelegate* d) OVERRIDE; |
| 242 TestURLFetcher* GetFetcherByID(int id) const; | 242 TestURLFetcher* GetFetcherByID(int id) const; |
| 243 void RemoveFetcherFromMap(int id); | 243 void RemoveFetcherFromMap(int id); |
| 244 size_t GetFetcherCount() const; | |
| 245 void SetDelegateForTests(TestURLFetcherDelegateForTests* delegate_for_tests); | 244 void SetDelegateForTests(TestURLFetcherDelegateForTests* delegate_for_tests); |
| 246 void set_remove_fetcher_on_delete(bool remove_fetcher_on_delete) { | 245 void set_remove_fetcher_on_delete(bool remove_fetcher_on_delete) { |
| 247 remove_fetcher_on_delete_ = remove_fetcher_on_delete; | 246 remove_fetcher_on_delete_ = remove_fetcher_on_delete; |
| 248 } | 247 } |
| 249 | 248 |
| 250 private: | 249 private: |
| 251 // Maps from id passed to create to the returned URLFetcher. | 250 // Maps from id passed to create to the returned URLFetcher. |
| 252 typedef std::map<int, TestURLFetcher*> Fetchers; | 251 typedef std::map<int, TestURLFetcher*> Fetchers; |
| 253 Fetchers fetchers_; | 252 Fetchers fetchers_; |
| 254 TestURLFetcherDelegateForTests* delegate_for_tests_; | 253 TestURLFetcherDelegateForTests* delegate_for_tests_; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 int id, | 413 int id, |
| 415 const GURL& url, | 414 const GURL& url, |
| 416 URLFetcher::RequestType request_type, | 415 URLFetcher::RequestType request_type, |
| 417 URLFetcherDelegate* d) OVERRIDE; | 416 URLFetcherDelegate* d) OVERRIDE; |
| 418 | 417 |
| 419 }; | 418 }; |
| 420 | 419 |
| 421 } // namespace net | 420 } // namespace net |
| 422 | 421 |
| 423 #endif // NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ | 422 #endif // NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ |
| OLD | NEW |