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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 namespace net { | 30 namespace net { |
31 | 31 |
32 ScopedURLFetcherFactory::ScopedURLFetcherFactory( | 32 ScopedURLFetcherFactory::ScopedURLFetcherFactory( |
33 URLFetcherFactory* factory) { | 33 URLFetcherFactory* factory) { |
34 DCHECK(!URLFetcherImpl::factory()); | 34 DCHECK(!URLFetcherImpl::factory()); |
35 URLFetcherImpl::set_factory(factory); | 35 URLFetcherImpl::set_factory(factory); |
36 } | 36 } |
37 | 37 |
38 ScopedURLFetcherFactory::~ScopedURLFetcherFactory() { | 38 ScopedURLFetcherFactory::~ScopedURLFetcherFactory() { |
| 39 DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
39 DCHECK(URLFetcherImpl::factory()); | 40 DCHECK(URLFetcherImpl::factory()); |
40 URLFetcherImpl::set_factory(NULL); | 41 URLFetcherImpl::set_factory(NULL); |
41 } | 42 } |
42 | 43 |
43 TestURLFetcher::TestURLFetcher(int id, const GURL& url, URLFetcherDelegate* d) | 44 TestURLFetcher::TestURLFetcher(int id, const GURL& url, URLFetcherDelegate* d) |
44 : owner_(NULL), | 45 : owner_(NULL), |
45 id_(id), | 46 id_(id), |
46 original_url_(url), | 47 original_url_(url), |
47 delegate_(d), | 48 delegate_(d), |
48 delegate_for_tests_(NULL), | 49 delegate_for_tests_(NULL), |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 int id, | 489 int id, |
489 const GURL& url, | 490 const GURL& url, |
490 URLFetcher::RequestType request_type, | 491 URLFetcher::RequestType request_type, |
491 URLFetcherDelegate* d, | 492 URLFetcherDelegate* d, |
492 NetworkTrafficAnnotationTag traffic_annotation) { | 493 NetworkTrafficAnnotationTag traffic_annotation) { |
493 return std::unique_ptr<URLFetcher>( | 494 return std::unique_ptr<URLFetcher>( |
494 new URLFetcherImpl(url, request_type, d, traffic_annotation)); | 495 new URLFetcherImpl(url, request_type, d, traffic_annotation)); |
495 } | 496 } |
496 | 497 |
497 } // namespace net | 498 } // namespace net |
OLD | NEW |