| 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 <stdint.h> |
| 9 |
| 8 #include <list> | 10 #include <list> |
| 9 #include <map> | 11 #include <map> |
| 10 #include <string> | 12 #include <string> |
| 11 #include <utility> | 13 #include <utility> |
| 12 | 14 |
| 13 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 14 #include "base/callback.h" | 16 #include "base/callback.h" |
| 15 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 16 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
| 17 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 303 |
| 302 const GURL& GetURL() const override; | 304 const GURL& GetURL() const override; |
| 303 | 305 |
| 304 ~FakeURLFetcher() override; | 306 ~FakeURLFetcher() override; |
| 305 | 307 |
| 306 private: | 308 private: |
| 307 // This is the method which actually calls the delegate that is passed in the | 309 // This is the method which actually calls the delegate that is passed in the |
| 308 // constructor. | 310 // constructor. |
| 309 void RunDelegate(); | 311 void RunDelegate(); |
| 310 | 312 |
| 313 int64_t response_bytes_; |
| 311 base::WeakPtrFactory<FakeURLFetcher> weak_factory_; | 314 base::WeakPtrFactory<FakeURLFetcher> weak_factory_; |
| 312 | 315 |
| 313 DISALLOW_COPY_AND_ASSIGN(FakeURLFetcher); | 316 DISALLOW_COPY_AND_ASSIGN(FakeURLFetcher); |
| 314 }; | 317 }; |
| 315 | 318 |
| 316 | 319 |
| 317 // FakeURLFetcherFactory is a factory for FakeURLFetcher objects. When | 320 // FakeURLFetcherFactory is a factory for FakeURLFetcher objects. When |
| 318 // instantiated, it sets itself up as the default URLFetcherFactory. Fake | 321 // instantiated, it sets itself up as the default URLFetcherFactory. Fake |
| 319 // responses for given URLs can be set using SetFakeResponse. | 322 // responses for given URLs can be set using SetFakeResponse. |
| 320 // | 323 // |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 // This method will create a real URLFetcher. | 458 // This method will create a real URLFetcher. |
| 456 scoped_ptr<URLFetcher> CreateURLFetcher(int id, | 459 scoped_ptr<URLFetcher> CreateURLFetcher(int id, |
| 457 const GURL& url, | 460 const GURL& url, |
| 458 URLFetcher::RequestType request_type, | 461 URLFetcher::RequestType request_type, |
| 459 URLFetcherDelegate* d) override; | 462 URLFetcherDelegate* d) override; |
| 460 }; | 463 }; |
| 461 | 464 |
| 462 } // namespace net | 465 } // namespace net |
| 463 | 466 |
| 464 #endif // NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ | 467 #endif // NET_URL_REQUEST_TEST_URL_FETCHER_FACTORY_H_ |
| OLD | NEW |