OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_COMMON_NET_TEST_URL_FETCHER_FACTORY_H_ | 5 #ifndef CHROME_COMMON_NET_TEST_URL_FETCHER_FACTORY_H_ |
6 #define CHROME_COMMON_NET_TEST_URL_FETCHER_FACTORY_H_ | 6 #define CHROME_COMMON_NET_TEST_URL_FETCHER_FACTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // in your tests. | 50 // in your tests. |
51 const GURL& original_url() const { return original_url_; } | 51 const GURL& original_url() const { return original_url_; } |
52 | 52 |
53 // Returns the data uploaded on this URLFetcher. | 53 // Returns the data uploaded on this URLFetcher. |
54 const std::string& upload_data() const { return URLFetcher::upload_data(); } | 54 const std::string& upload_data() const { return URLFetcher::upload_data(); } |
55 | 55 |
56 // Overriden to do nothing. URLFetcher implementation add reference | 56 // Overriden to do nothing. URLFetcher implementation add reference |
57 // to request_context_getter in core_, but it might not be released | 57 // to request_context_getter in core_, but it might not be released |
58 // because we wouldn't call Core::CancelURLRequest. | 58 // because we wouldn't call Core::CancelURLRequest. |
59 // Without this, we'll see leaks of URLRequestContext in test. | 59 // Without this, we'll see leaks of URLRequestContext in test. |
60 virtual void set_requeset_context( | 60 virtual void set_request_context( |
61 URLRequestContextGetter* request_context_getter) {} | 61 URLRequestContextGetter* request_context_getter) {} |
62 | 62 |
63 private: | 63 private: |
64 const GURL original_url_; | 64 const GURL original_url_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(TestURLFetcher); | 66 DISALLOW_COPY_AND_ASSIGN(TestURLFetcher); |
67 }; | 67 }; |
68 | 68 |
69 // Simple URLFetcher::Factory method that creates TestURLFetchers. All fetchers | 69 // Simple URLFetcher::Factory method that creates TestURLFetchers. All fetchers |
70 // are registered in a map by the id passed to the create method. | 70 // are registered in a map by the id passed to the create method. |
(...skipping 10 matching lines...) Expand all Loading... |
81 | 81 |
82 private: | 82 private: |
83 // Maps from id passed to create to the returned URLFetcher. | 83 // Maps from id passed to create to the returned URLFetcher. |
84 typedef std::map<int, TestURLFetcher*> Fetchers; | 84 typedef std::map<int, TestURLFetcher*> Fetchers; |
85 Fetchers fetchers_; | 85 Fetchers fetchers_; |
86 | 86 |
87 DISALLOW_COPY_AND_ASSIGN(TestURLFetcherFactory); | 87 DISALLOW_COPY_AND_ASSIGN(TestURLFetcherFactory); |
88 }; | 88 }; |
89 | 89 |
90 #endif // CHROME_COMMON_NET_TEST_URL_FETCHER_FACTORY_H_ | 90 #endif // CHROME_COMMON_NET_TEST_URL_FETCHER_FACTORY_H_ |
OLD | NEW |