Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: components/image_fetcher/image_decoder.h

Issue 2111573002: Add ios_image_decoder_impl.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo in ios_chrome.gyp Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_IMAGE_FETCHER_IMAGE_DECODER_H_ 5 #ifndef COMPONENTS_IMAGE_FETCHER_IMAGE_DECODER_H_
6 #define COMPONENTS_IMAGE_FETCHER_IMAGE_DECODER_H_ 6 #define COMPONENTS_IMAGE_FETCHER_IMAGE_DECODER_H_
7 7
8 #include <string> 8 #include <string>
9
9 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/macros.h"
10 12
11 namespace gfx { 13 namespace gfx {
12 class Image; 14 class Image;
13 } // namespace gfx 15 } // namespace gfx
14 16
15 namespace image_fetcher { 17 namespace image_fetcher {
16 18
17 using ImageDecodedCallback = base::Callback<void(const gfx::Image&)>; 19 using ImageDecodedCallback = base::Callback<void(const gfx::Image&)>;
18 20
19 // ImageDecoder defines the common interface for decoding images. 21 // ImageDecoder defines the common interface for decoding images.
20 class ImageDecoder { 22 class ImageDecoder {
21 public: 23 public:
22 ImageDecoder() {} 24 ImageDecoder() {}
23 virtual ~ImageDecoder() {} 25 virtual ~ImageDecoder() {}
24 26
25 // Decodes the passed |image_data| and runs the given callback. The callback 27 // Decodes the passed |image_data| and runs the given callback. The callback
26 // is run even if decoding the image fails. In case an error occured during 28 // is run even if decoding the image fails. In case an error occured during
27 // decoding the image an empty image is passed to the callback. 29 // decoding the image an empty image is passed to the callback.
28 virtual void DecodeImage(const std::string& image_data, 30 virtual void DecodeImage(const std::string& image_data,
29 const ImageDecodedCallback& callback) = 0; 31 const ImageDecodedCallback& callback) = 0;
30 32
31 private: 33 private:
32 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); 34 DISALLOW_COPY_AND_ASSIGN(ImageDecoder);
33 }; 35 };
34 36
35 } // namespace image_fetcher 37 } // namespace image_fetcher
36 38
37 #endif // COMPONENTS_IMAGE_FETCHER_IMAGE_DECODER_H_ 39 #endif // COMPONENTS_IMAGE_FETCHER_IMAGE_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698