Updating XTBs based on .GRDs from branch master
[chromium-blink-merge.git] / media / formats / mp4 / rcheck.h
blobd7564874d86dc150b86b1aae21b874c05c3beee1
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
3 // found in the LICENSE file.
5 #ifndef MEDIA_FORMATS_MP4_RCHECK_H_
6 #define MEDIA_FORMATS_MP4_RCHECK_H_
8 #include "base/logging.h"
9 #include "media/base/media_log.h"
11 #define RCHECK_MEDIA_LOGGED(condition, log_cb, msg) \
12 do { \
13 if (!(condition)) { \
14 DLOG(ERROR) << "Failure while parsing MP4: " #condition; \
15 MEDIA_LOG(ERROR, log_cb) << "Failure parsing MP4: " << (msg); \
16 return false; \
17 } \
18 } while (0)
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; \
26 return false; \
27 } \
28 } while (0)
30 #endif // MEDIA_FORMATS_MP4_RCHECK_H_