| 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 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 14 #include "base/sequence_checker.h" | 15 #include "base/sequence_checker.h" |
| 15 #include "base/sequenced_task_runner.h" | 16 #include "base/sequenced_task_runner.h" |
| 16 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 17 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
| 19 #include "build/build_config.h" |
| 18 #include "content/public/browser/utility_process_host.h" | 20 #include "content/public/browser/utility_process_host.h" |
| 19 #include "content/public/browser/utility_process_host_client.h" | 21 #include "content/public/browser/utility_process_host_client.h" |
| 20 | 22 |
| 21 class SkBitmap; | 23 class SkBitmap; |
| 22 | 24 |
| 23 // This is a helper class for decoding images safely in a utility process. To | 25 // This is a helper class for decoding images safely in a utility process. To |
| 24 // use this, call ImageDecoder::Start(...) or | 26 // use this, call ImageDecoder::Start(...) or |
| 25 // ImageDecoder::StartWithOptions(...) on any thread. | 27 // ImageDecoder::StartWithOptions(...) on any thread. |
| 26 // | 28 // |
| 27 // Internally, most of the work happens on the IO thread, and then | 29 // Internally, most of the work happens on the IO thread, and then |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 base::WeakPtr<content::UtilityProcessHost> utility_process_host_; | 151 base::WeakPtr<content::UtilityProcessHost> utility_process_host_; |
| 150 | 152 |
| 151 // Calls StopBatchMode() after |kBatchModeTimeoutSeconds| have elapsed, | 153 // Calls StopBatchMode() after |kBatchModeTimeoutSeconds| have elapsed, |
| 152 // unless a new decoding request resets the timer. | 154 // unless a new decoding request resets the timer. |
| 153 scoped_ptr<base::DelayTimer> batch_mode_timer_; | 155 scoped_ptr<base::DelayTimer> batch_mode_timer_; |
| 154 | 156 |
| 155 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); | 157 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); |
| 156 }; | 158 }; |
| 157 | 159 |
| 158 #endif // CHROME_BROWSER_IMAGE_DECODER_H_ | 160 #endif // CHROME_BROWSER_IMAGE_DECODER_H_ |
| OLD | NEW |