| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
| 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // A RequestDelegate is created to download each OSDD. When done downloading | 61 // A RequestDelegate is created to download each OSDD. When done downloading |
| 62 // RequestCompleted is invoked back on the TemplateURLFetcher. | 62 // RequestCompleted is invoked back on the TemplateURLFetcher. |
| 63 class RequestDelegate; | 63 class RequestDelegate; |
| 64 | 64 |
| 65 // Invoked from the RequestDelegate when done downloading. Virtual for tests. | 65 // Invoked from the RequestDelegate when done downloading. Virtual for tests. |
| 66 virtual void RequestCompleted(RequestDelegate* request); | 66 virtual void RequestCompleted(RequestDelegate* request); |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 friend class RequestDelegate; | 69 friend class RequestDelegate; |
| 70 | 70 |
| 71 typedef ScopedVector<RequestDelegate> Requests; | |
| 72 | |
| 73 TemplateURLService* template_url_service_; | 71 TemplateURLService* template_url_service_; |
| 74 scoped_refptr<net::URLRequestContextGetter> request_context_; | 72 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 75 | 73 |
| 76 // In progress requests. | 74 // In progress requests. |
| 77 Requests requests_; | 75 std::vector<std::unique_ptr<RequestDelegate>> requests_; |
| 78 | 76 |
| 79 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcher); | 77 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcher); |
| 80 }; | 78 }; |
| 81 | 79 |
| 82 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ | 80 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
| OLD | NEW |