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

Unified Diff: base/win/scoped_handle.h

Issue 1407443002: Remove old C++03 move emulation code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: std::move and reflow Created 5 years, 1 month 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 | « base/process/process_win.cc ('k') | chrome/browser/printing/pdf_to_emf_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/scoped_handle.h
diff --git a/base/win/scoped_handle.h b/base/win/scoped_handle.h
index d1eb1d688aeb5410c0cdf34ca45026f7fbd3a202..3e8a7484c137ab37ca2af5a4f3a7cf9304d1875f 100644
--- a/base/win/scoped_handle.h
+++ b/base/win/scoped_handle.h
@@ -36,7 +36,7 @@ namespace win {
// this explicitly is necessary because of bug 528394 and VC++ 2015.
template <class Traits, class Verifier>
class GenericScopedHandle {
- MOVE_ONLY_TYPE_FOR_CPP_03(GenericScopedHandle, RValue)
+ MOVE_ONLY_TYPE_FOR_CPP_03(GenericScopedHandle)
public:
typedef typename Traits::Handle Handle;
@@ -47,9 +47,9 @@ class GenericScopedHandle {
Set(handle);
}
- // Move constructor for C++03 move emulation of this type.
- GenericScopedHandle(RValue other) : handle_(Traits::NullHandle()) {
- Set(other.object->Take());
+ GenericScopedHandle(GenericScopedHandle&& other)
+ : handle_(Traits::NullHandle()) {
+ Set(other.Take());
}
~GenericScopedHandle() {
@@ -60,11 +60,9 @@ class GenericScopedHandle {
return Traits::IsHandleValid(handle_);
}
- // Move operator= for C++03 move emulation of this type.
- GenericScopedHandle& operator=(RValue other) {
- if (this != other.object) {
- Set(other.object->Take());
- }
+ GenericScopedHandle& operator=(GenericScopedHandle&& other) {
+ DCHECK_NE(this, &other);
+ Set(other.Take());
return *this;
}
« no previous file with comments | « base/process/process_win.cc ('k') | chrome/browser/printing/pdf_to_emf_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698