Index: webrtc/api/optional.h |
diff --git a/webrtc/rtc_base/optional.h b/webrtc/api/optional.h |
similarity index 97% |
copy from webrtc/rtc_base/optional.h |
copy to webrtc/api/optional.h |
index ca3208e4d55bdcb9493f915d8800beb2d6eb6d5e..de1ec764bfbd881d1a805d73d92b54166818433c 100644 |
--- a/webrtc/rtc_base/optional.h |
+++ b/webrtc/api/optional.h |
@@ -8,8 +8,8 @@ |
* be found in the AUTHORS file in the root of the source tree. |
*/ |
-#ifndef WEBRTC_RTC_BASE_OPTIONAL_H_ |
-#define WEBRTC_RTC_BASE_OPTIONAL_H_ |
+#ifndef WEBRTC_API_OPTIONAL_H_ |
+#define WEBRTC_API_OPTIONAL_H_ |
#include <algorithm> |
#include <memory> |
@@ -44,7 +44,9 @@ inline T* FunctionThatDoesNothing(T* x) { |
#else |
template <typename T> |
-inline T* FunctionThatDoesNothing(T* x) { return x; } |
+inline T* FunctionThatDoesNothing(T* x) { |
+ return x; |
+} |
#endif |
@@ -96,9 +98,7 @@ template <typename T> |
class Optional final { |
public: |
// Construct an empty Optional. |
- Optional() : has_value_(false), empty_('\0') { |
- PoisonValue(); |
- } |
+ Optional() : has_value_(false), empty_('\0') { PoisonValue(); } |
// Construct an Optional that contains a value. |
explicit Optional(const T& value) : has_value_(true) { |
@@ -293,9 +293,7 @@ class Optional final { |
} |
// Tell sanitizers that value_ is OK to touch again. |
- void UnpoisonValue() { |
- rtc::AsanUnpoison(rtc::MakeArrayView(&value_, 1)); |
- } |
+ void UnpoisonValue() { rtc::AsanUnpoison(rtc::MakeArrayView(&value_, 1)); } |
bool has_value_; // True iff value_ contains a live value. |
union { |
@@ -406,4 +404,4 @@ void PrintTo(const rtc::Optional<T>& opt, std::ostream* os) { |
} // namespace rtc |
-#endif // WEBRTC_RTC_BASE_OPTIONAL_H_ |
+#endif // WEBRTC_API_OPTIONAL_H_ |