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 CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 5 #ifndef CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ |
6 #define CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 6 #define CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 const Callback& callback); | 30 const Callback& callback); |
31 | 31 |
32 virtual ~MultiResolutionImageResourceFetcher(); | 32 virtual ~MultiResolutionImageResourceFetcher(); |
33 | 33 |
34 // URL of the image we're downloading. | 34 // URL of the image we're downloading. |
35 const GURL& image_url() const { return image_url_; } | 35 const GURL& image_url() const { return image_url_; } |
36 | 36 |
37 // Unique identifier for the request. | 37 // Unique identifier for the request. |
38 int id() const { return id_; } | 38 int id() const { return id_; } |
39 | 39 |
| 40 // HTTP status code upon fetch completion. |
| 41 int http_status_code() const { return http_status_code_; } |
| 42 |
40 private: | 43 private: |
41 // ResourceFetcher::Callback. Decodes the image and invokes callback_. | 44 // ResourceFetcher::Callback. Decodes the image and invokes callback_. |
42 void OnURLFetchComplete(const WebKit::WebURLResponse& response, | 45 void OnURLFetchComplete(const WebKit::WebURLResponse& response, |
43 const std::string& data); | 46 const std::string& data); |
44 | 47 |
45 Callback callback_; | 48 Callback callback_; |
46 | 49 |
47 // Unique identifier for the request. | 50 // Unique identifier for the request. |
48 const int id_; | 51 const int id_; |
49 | 52 |
| 53 // HTTP status code upon fetch completion. |
| 54 int http_status_code_; |
| 55 |
50 // URL of the image. | 56 // URL of the image. |
51 const GURL image_url_; | 57 const GURL image_url_; |
52 | 58 |
53 // Does the actual download. | 59 // Does the actual download. |
54 scoped_ptr<ResourceFetcher> fetcher_; | 60 scoped_ptr<ResourceFetcher> fetcher_; |
55 | 61 |
56 DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); | 62 DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); |
57 }; | 63 }; |
58 | 64 |
59 } // namespace content | 65 } // namespace content |
60 | 66 |
61 #endif // CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 67 #endif // CONTENT_RENDERER_FETCHERS_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ |
OLD | NEW |