OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MEDIA_FORMATS_MP4_RCHECK_H_ | 5 #ifndef MEDIA_FORMATS_MP4_RCHECK_H_ |
6 #define MEDIA_FORMATS_MP4_RCHECK_H_ | 6 #define MEDIA_FORMATS_MP4_RCHECK_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "media/base/media_log.h" | |
9 | 10 |
10 #define RCHECK(x) \ | 11 #define RCHECK_MEDIA_LOGGED(condition, log_cb, msg) \ |
11 do { \ | 12 do { \ |
12 if (!(x)) { \ | 13 if (!(condition)) { \ |
13 DLOG(ERROR) << "Failure while parsing MP4: " << #x; \ | 14 DLOG(ERROR) << "Failure while parsing MP4: " #condition; \ |
DaleCurtis
2015/05/15 18:45:37
<< before # ?
| |
14 return false; \ | 15 MEDIA_LOG(ERROR, log_cb) << "Failure parsing MP4: " << (msg); \ |
15 } \ | 16 return false; \ |
16 } while (0) | 17 } \ |
18 } while (0) | |
19 | |
20 // TODO(wolenetz,chcunningham): Where appropriate, replace usage of this macro | |
21 // in favor of RCHECK_MEDIA_LOGGED. See https://crbug.com/487410. | |
22 #define RCHECK(condition) \ | |
23 do { \ | |
24 if (!(condition)) { \ | |
25 DLOG(ERROR) << "Failure while parsing MP4: " #condition; \ | |
DaleCurtis
2015/05/15 18:45:37
Ditto
| |
26 return false; \ | |
27 } \ | |
28 } while (0) | |
17 | 29 |
18 #endif // MEDIA_FORMATS_MP4_RCHECK_H_ | 30 #endif // MEDIA_FORMATS_MP4_RCHECK_H_ |
OLD | NEW |