Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: media/base/timestamp_constants.h

Issue 2158923004: Convert media constants to constexpr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 MEDIA_BASE_TIMESTAMP_CONSTANTS_H_ 5 #ifndef MEDIA_BASE_TIMESTAMP_CONSTANTS_H_
6 #define MEDIA_BASE_TIMESTAMP_CONSTANTS_H_ 6 #define MEDIA_BASE_TIMESTAMP_CONSTANTS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
11 11
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "media/base/media_export.h"
14 13
15 namespace media { 14 namespace media {
16 15
17 // Indicates an invalid or missing timestamp. 16 // Indicates an invalid or missing timestamp.
18 MEDIA_EXPORT inline base::TimeDelta kNoTimestamp() { 17 constexpr base::TimeDelta kNoTimestamp =
19 return base::TimeDelta::FromMicroseconds(std::numeric_limits<int64_t>::min()); 18 base::TimeDelta::FromMicroseconds(std::numeric_limits<int64_t>::min());
20 }
21 19
22 // Represents an infinite stream duration. 20 // Represents an infinite stream duration.
23 MEDIA_EXPORT inline base::TimeDelta kInfiniteDuration() { 21 constexpr base::TimeDelta kInfiniteDuration =
24 return base::TimeDelta::Max(); 22 base::TimeDelta::FromMicroseconds(std::numeric_limits<int64_t>::max());
25 }
26 23
27 } // namespace media 24 } // namespace media
28 25
29 #endif // MEDIA_BASE_TIMESTAMP_CONSTANTS_H_ 26 #endif // MEDIA_BASE_TIMESTAMP_CONSTANTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698