| 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 CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ |
| 6 #define CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ | 6 #define CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 typedef std::vector<base::Callback<void(const GURL&, const SkBitmap*)> > | 44 typedef std::vector<base::Callback<void(const GURL&, const SkBitmap*)> > |
| 45 CallbackVector; | 45 CallbackVector; |
| 46 | 46 |
| 47 // State related to an image fetch (associated website url, image_url, | 47 // State related to an image fetch (associated website url, image_url, |
| 48 // fetcher, pending callbacks). | 48 // fetcher, pending callbacks). |
| 49 struct ImageRequest { | 49 struct ImageRequest { |
| 50 ImageRequest(); | 50 ImageRequest(); |
| 51 // Struct takes ownership of |f|. | 51 // Struct takes ownership of |f|. |
| 52 explicit ImageRequest(chrome::BitmapFetcher* f); | 52 explicit ImageRequest(chrome::BitmapFetcher* f); |
| 53 ImageRequest(const ImageRequest& other); |
| 53 ~ImageRequest(); | 54 ~ImageRequest(); |
| 54 | 55 |
| 55 void swap(ImageRequest* other) { | 56 void swap(ImageRequest* other) { |
| 56 std::swap(url, other->url); | 57 std::swap(url, other->url); |
| 57 std::swap(image_url, other->image_url); | 58 std::swap(image_url, other->image_url); |
| 58 std::swap(callbacks, other->callbacks); | 59 std::swap(callbacks, other->callbacks); |
| 59 std::swap(fetcher, other->fetcher); | 60 std::swap(fetcher, other->fetcher); |
| 60 } | 61 } |
| 61 | 62 |
| 62 GURL url; | 63 GURL url; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 76 ImageFetcherDelegate* delegate_; | 77 ImageFetcherDelegate* delegate_; |
| 77 | 78 |
| 78 net::URLRequestContextGetter* url_request_context_; | 79 net::URLRequestContextGetter* url_request_context_; |
| 79 | 80 |
| 80 DISALLOW_COPY_AND_ASSIGN(ImageFetcherImpl); | 81 DISALLOW_COPY_AND_ASSIGN(ImageFetcherImpl); |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 } // namespace suggestions | 84 } // namespace suggestions |
| 84 | 85 |
| 85 #endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ | 86 #endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_FETCHER_IMPL_H_ |
| OLD | NEW |