Chromium Code Reviews| 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 WEBKIT_GLUE_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 5 #ifndef WEBKIT_GLUE_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ |
| 6 #define WEBKIT_GLUE_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 6 #define WEBKIT_GLUE_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 20 matching lines...) Expand all Loading... | |
| 31 const Callback& callback); | 31 const Callback& callback); |
| 32 | 32 |
| 33 WEBKIT_GLUE_EXPORT virtual ~MultiResolutionImageResourceFetcher(); | 33 WEBKIT_GLUE_EXPORT virtual ~MultiResolutionImageResourceFetcher(); |
| 34 | 34 |
| 35 // URL of the image we're downloading. | 35 // URL of the image we're downloading. |
| 36 const GURL& image_url() const { return image_url_; } | 36 const GURL& image_url() const { return image_url_; } |
| 37 | 37 |
| 38 // Unique identifier for the request. | 38 // Unique identifier for the request. |
| 39 int id() const { return id_; } | 39 int id() const { return id_; } |
| 40 | 40 |
| 41 // HTTP status code upon fetch completion. | |
| 42 int http_status_code() { return http_status_code_; } | |
|
sky
2013/05/03 20:24:54
const?
mef
2013/05/03 21:45:59
Done.
| |
| 43 | |
| 41 private: | 44 private: |
| 42 // ResourceFetcher::Callback. Decodes the image and invokes callback_. | 45 // ResourceFetcher::Callback. Decodes the image and invokes callback_. |
| 43 void OnURLFetchComplete(const WebKit::WebURLResponse& response, | 46 void OnURLFetchComplete(const WebKit::WebURLResponse& response, |
| 44 const std::string& data); | 47 const std::string& data); |
| 45 | 48 |
| 46 Callback callback_; | 49 Callback callback_; |
| 47 | 50 |
| 48 // Unique identifier for the request. | 51 // Unique identifier for the request. |
| 49 const int id_; | 52 const int id_; |
| 50 | 53 |
| 54 // HTTP status code upon fetch completion. | |
| 55 int http_status_code_; | |
| 56 | |
| 51 // URL of the image. | 57 // URL of the image. |
| 52 const GURL image_url_; | 58 const GURL image_url_; |
| 53 | 59 |
| 54 // Does the actual download. | 60 // Does the actual download. |
| 55 scoped_ptr<ResourceFetcher> fetcher_; | 61 scoped_ptr<ResourceFetcher> fetcher_; |
| 56 | 62 |
| 57 DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); | 63 DISALLOW_COPY_AND_ASSIGN(MultiResolutionImageResourceFetcher); |
| 58 }; | 64 }; |
| 59 | 65 |
| 60 } // namespace webkit_glue | 66 } // namespace webkit_glue |
| 61 | 67 |
| 62 #endif // WEBKIT_GLUE_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ | 68 #endif // WEBKIT_GLUE_MULTI_RESOLUTION_IMAGE_RESOURCE_FETCHER_H_ |
| OLD | NEW |