OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_COMMON_GPU_MEDIA_AVDA_RETURN_ON_FAILURE_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_AVDA_RETURN_ON_FAILURE_H_ |
| 7 |
| 8 // Helper macros for dealing with failure. If |result| evaluates false, emit |
| 9 // |log| to ERROR, register |error| with the decoder, and return. This will |
| 10 // also transition to the error state, stopping further decoding. |
| 11 // This is meant to be used only within AndroidVideoDecoderBase and its |
| 12 // various subclasses. |
| 13 #define RETURN_ON_FAILURE(result, log, error) \ |
| 14 do { \ |
| 15 if (!(result)) { \ |
| 16 DLOG(ERROR) << log; \ |
| 17 PostError(FROM_HERE, error); \ |
| 18 return; \ |
| 19 } \ |
| 20 } while (0) |
| 21 |
| 22 #endif // CONTENT_COMMON_GPU_MEDIA_AVDA_RETURN_ON_FAILURE_H_ |
OLD | NEW |