| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/chromeos/login/image_decoder.h" | 5 #include "chrome/browser/image_decoder.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/common/chrome_utility_messages.h" | 9 #include "chrome/common/chrome_utility_messages.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| 11 | 11 |
| 12 using content::BrowserThread; | 12 using content::BrowserThread; |
| 13 | 13 |
| 14 namespace chromeos { | |
| 15 | |
| 16 ImageDecoder::ImageDecoder(Delegate* delegate, | 14 ImageDecoder::ImageDecoder(Delegate* delegate, |
| 17 const std::string& image_data) | 15 const std::string& image_data) |
| 18 : delegate_(delegate), | 16 : delegate_(delegate), |
| 19 image_data_(image_data.begin(), image_data.end()), | 17 image_data_(image_data.begin(), image_data.end()), |
| 20 target_thread_id_(BrowserThread::UI) { | 18 target_thread_id_(BrowserThread::UI) { |
| 21 } | 19 } |
| 22 | 20 |
| 23 ImageDecoder::~ImageDecoder() {} | 21 ImageDecoder::~ImageDecoder() {} |
| 24 | 22 |
| 25 void ImageDecoder::Start() { | 23 void ImageDecoder::Start() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 55 } |
| 58 | 56 |
| 59 void ImageDecoder::DecodeImageInSandbox( | 57 void ImageDecoder::DecodeImageInSandbox( |
| 60 const std::vector<unsigned char>& image_data) { | 58 const std::vector<unsigned char>& image_data) { |
| 61 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 59 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 62 UtilityProcessHost* utility_process_host = | 60 UtilityProcessHost* utility_process_host = |
| 63 new UtilityProcessHost(this, | 61 new UtilityProcessHost(this, |
| 64 target_thread_id_); | 62 target_thread_id_); |
| 65 utility_process_host->Send(new ChromeUtilityMsg_DecodeImage(image_data)); | 63 utility_process_host->Send(new ChromeUtilityMsg_DecodeImage(image_data)); |
| 66 } | 64 } |
| 67 | |
| 68 } // namespace chromeos | |
| OLD | NEW |