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

Unified Diff: webrtc/api/optional.h

Issue 3011943002: Move optional.h to webrtc/api/ (Closed)
Patch Set: Created 3 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/mediastreaminterface.h ('k') | webrtc/api/optional.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « webrtc/api/mediastreaminterface.h ('k') | webrtc/api/optional.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698