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

Side by Side Diff: chrome/browser/image_decoder.h

Issue 16703003: Remove trampoline between threads in SupportedImageTypeValidator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/supported_image_type_validator.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 (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 CHROME_BROWSER_IMAGE_DECODER_H_ 5 #ifndef CHROME_BROWSER_IMAGE_DECODER_H_
6 #define CHROME_BROWSER_IMAGE_DECODER_H_ 6 #define CHROME_BROWSER_IMAGE_DECODER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 enum ImageCodec { 37 enum ImageCodec {
38 DEFAULT_CODEC = 0, // Uses WebKit image decoding (via WebImage). 38 DEFAULT_CODEC = 0, // Uses WebKit image decoding (via WebImage).
39 ROBUST_JPEG_CODEC, // Restrict decoding to robust jpeg codec. 39 ROBUST_JPEG_CODEC, // Restrict decoding to robust jpeg codec.
40 }; 40 };
41 41
42 ImageDecoder(Delegate* delegate, 42 ImageDecoder(Delegate* delegate,
43 const std::string& image_data, 43 const std::string& image_data,
44 ImageCodec image_codec); 44 ImageCodec image_codec);
45 45
46 // Starts image decoding on current thread of |task_runner|. 46 // Starts asynchronous image decoding. Once finished, the callback will be
47 // posted back to |task_runner|.
47 void Start(scoped_refptr<base::SequencedTaskRunner> task_runner); 48 void Start(scoped_refptr<base::SequencedTaskRunner> task_runner);
48 49
49 const std::vector<unsigned char>& get_image_data() const { 50 const std::vector<unsigned char>& get_image_data() const {
50 return image_data_; 51 return image_data_;
51 } 52 }
52 53
53 void set_delegate(Delegate* delegate) { delegate_ = delegate; } 54 void set_delegate(Delegate* delegate) { delegate_ = delegate; }
54 55
55 private: 56 private:
56 // It's a reference counted object, so destructor is private. 57 // It's a reference counted object, so destructor is private.
(...skipping 11 matching lines...) Expand all
68 69
69 Delegate* delegate_; 70 Delegate* delegate_;
70 std::vector<unsigned char> image_data_; 71 std::vector<unsigned char> image_data_;
71 const ImageCodec image_codec_; 72 const ImageCodec image_codec_;
72 scoped_refptr<base::SequencedTaskRunner> task_runner_; 73 scoped_refptr<base::SequencedTaskRunner> task_runner_;
73 74
74 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); 75 DISALLOW_COPY_AND_ASSIGN(ImageDecoder);
75 }; 76 };
76 77
77 #endif // CHROME_BROWSER_IMAGE_DECODER_H_ 78 #endif // CHROME_BROWSER_IMAGE_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698