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

Side by Side Diff: webrtc/api/rtcerror.h

Issue 2709573003: Move rtc_api_unittests into rtc_unittests. (Closed)
Patch Set: Fix Windows-specific issue. Created 3 years, 10 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
« no previous file with comments | « webrtc/api/BUILD.gn ('k') | webrtc/api/rtcerror_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 // when the return type is RTCErrorOr<T>. 226 // when the return type is RTCErrorOr<T>.
227 RTCErrorOr(T value) : value_(std::move(value)) {} 227 RTCErrorOr(T value) : value_(std::move(value)) {}
228 228
229 // Delete the copy constructor and assignment operator; there aren't any use 229 // Delete the copy constructor and assignment operator; there aren't any use
230 // cases where you should need to copy an RTCErrorOr, as opposed to moving 230 // cases where you should need to copy an RTCErrorOr, as opposed to moving
231 // it. Can revisit this decision if use cases arise in the future. 231 // it. Can revisit this decision if use cases arise in the future.
232 RTCErrorOr(const RTCErrorOr& other) = delete; 232 RTCErrorOr(const RTCErrorOr& other) = delete;
233 RTCErrorOr& operator=(const RTCErrorOr& other) = delete; 233 RTCErrorOr& operator=(const RTCErrorOr& other) = delete;
234 234
235 // Move constructor and move-assignment operator. 235 // Move constructor and move-assignment operator.
236 RTCErrorOr(RTCErrorOr&& other) = default; 236 //
237 RTCErrorOr& operator=(RTCErrorOr&& other) = default; 237 // Visual Studio doesn't support "= default" with move constructors or
238 // assignment operators (even though they compile, they segfault), so define
239 // them explicitly.
240 RTCErrorOr(RTCErrorOr&& other)
241 : error_(std::move(other.error_)), value_(std::move(other.value_)) {}
242 RTCErrorOr& operator=(RTCErrorOr&& other) {
243 error_ = std::move(other.error_);
244 value_ = std::move(other.value_);
245 return *this;
246 }
238 247
239 // Conversion constructor and assignment operator; T must be copy or move 248 // Conversion constructor and assignment operator; T must be copy or move
240 // constructible from U. 249 // constructible from U.
241 template <typename U> 250 template <typename U>
242 RTCErrorOr(RTCErrorOr<U> other) 251 RTCErrorOr(RTCErrorOr<U> other)
243 : error_(std::move(other.error_)), value_(std::move(other.value_)) {} 252 : error_(std::move(other.error_)), value_(std::move(other.value_)) {}
244 template <typename U> 253 template <typename U>
245 RTCErrorOr& operator=(RTCErrorOr<U> other) { 254 RTCErrorOr& operator=(RTCErrorOr<U> other) {
246 error_ = std::move(other.error_); 255 error_ = std::move(other.error_);
247 value_ = std::move(other.value_); 256 value_ = std::move(other.value_);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 291 }
283 292
284 private: 293 private:
285 RTCError error_; 294 RTCError error_;
286 T value_; 295 T value_;
287 }; 296 };
288 297
289 } // namespace webrtc 298 } // namespace webrtc
290 299
291 #endif // WEBRTC_API_RTCERROR_H_ 300 #endif // WEBRTC_API_RTCERROR_H_
OLDNEW
« no previous file with comments | « webrtc/api/BUILD.gn ('k') | webrtc/api/rtcerror_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698