| 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 <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 // Stops batch mode if no requests have come in since | 123 // Stops batch mode if no requests have come in since |
| 124 // |kBatchModeTimeoutSeconds|. | 124 // |kBatchModeTimeoutSeconds|. |
| 125 void StopBatchMode(); | 125 void StopBatchMode(); |
| 126 | 126 |
| 127 // Fails all outstanding requests. | 127 // Fails all outstanding requests. |
| 128 void FailAllRequests(); | 128 void FailAllRequests(); |
| 129 | 129 |
| 130 // Overidden from UtilityProcessHostClient. | 130 // Overidden from UtilityProcessHostClient. |
| 131 void OnProcessCrashed(int exit_code) override; | 131 void OnProcessCrashed(int exit_code) override; |
| 132 void OnProcessLaunchFailed() override; | 132 void OnProcessLaunchFailed(int error_code) override; |
| 133 bool OnMessageReceived(const IPC::Message& message) override; | 133 bool OnMessageReceived(const IPC::Message& message) override; |
| 134 | 134 |
| 135 // IPC message handlers. | 135 // IPC message handlers. |
| 136 void OnDecodeImageSucceeded(const SkBitmap& decoded_image, int request_id); | 136 void OnDecodeImageSucceeded(const SkBitmap& decoded_image, int request_id); |
| 137 void OnDecodeImageFailed(int request_id); | 137 void OnDecodeImageFailed(int request_id); |
| 138 | 138 |
| 139 // For the ImageRequest identified by |request_id|, call its OnImageDecoded() | 139 // For the ImageRequest identified by |request_id|, call its OnImageDecoded() |
| 140 // or OnDecodeImageFailed() method on its task runner thread. | 140 // or OnDecodeImageFailed() method on its task runner thread. |
| 141 void RunOnImageDecoded(const SkBitmap& decoded_image, int request_id); | 141 void RunOnImageDecoded(const SkBitmap& decoded_image, int request_id); |
| 142 void RunOnDecodeImageFailed(int request_id); | 142 void RunOnDecodeImageFailed(int request_id); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 158 std::unique_ptr<base::DelayTimer> batch_mode_timer_; | 158 std::unique_ptr<base::DelayTimer> batch_mode_timer_; |
| 159 | 159 |
| 160 // Mojo service connection. Must always be bound/reset and used on the IO | 160 // Mojo service connection. Must always be bound/reset and used on the IO |
| 161 // thread. | 161 // thread. |
| 162 mojom::ImageDecoderPtr decoder_; | 162 mojom::ImageDecoderPtr decoder_; |
| 163 | 163 |
| 164 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); | 164 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 #endif // CHROME_BROWSER_IMAGE_DECODER_H_ | 167 #endif // CHROME_BROWSER_IMAGE_DECODER_H_ |
| OLD | NEW |