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

Unified Diff: base/files/file.cc

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/files/file.h ('k') | base/memory/scoped_vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file.cc
diff --git a/base/files/file.cc b/base/files/file.cc
index 47b9f88f1888d1d3cf4b70070b460bd8e8880289..036d43b33c50d6efd816d64005c6a18ce4ab34e9 100644
--- a/base/files/file.cc
+++ b/base/files/file.cc
@@ -50,13 +50,12 @@ File::File(Error error_details)
async_(false) {
}
-File::File(RValue other)
- : file_(other.object->TakePlatformFile()),
- tracing_path_(other.object->tracing_path_),
- error_details_(other.object->error_details()),
- created_(other.object->created()),
- async_(other.object->async_) {
-}
+File::File(File&& other)
+ : file_(other.TakePlatformFile()),
+ tracing_path_(other.tracing_path_),
+ error_details_(other.error_details()),
+ created_(other.created()),
+ async_(other.async_) {}
File::~File() {
// Go through the AssertIOAllowed logic.
@@ -72,15 +71,14 @@ File File::CreateForAsyncHandle(PlatformFile platform_file) {
return file.Pass();
}
-File& File::operator=(RValue other) {
- if (this != other.object) {
- Close();
- SetPlatformFile(other.object->TakePlatformFile());
- tracing_path_ = other.object->tracing_path_;
- error_details_ = other.object->error_details();
- created_ = other.object->created();
- async_ = other.object->async_;
- }
+File& File::operator=(File&& other) {
+ DCHECK_NE(this, &other);
+ Close();
+ SetPlatformFile(other.TakePlatformFile());
+ tracing_path_ = other.tracing_path_;
+ error_details_ = other.error_details();
+ created_ = other.created();
+ async_ = other.async_;
return *this;
}
« no previous file with comments | « base/files/file.h ('k') | base/memory/scoped_vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698