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

Side by Side Diff: net/base/file_stream_context.cc

Issue 1407443002: Remove old C++03 move emulation code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/file_stream_context.h" 5 #include "net/base/file_stream_context.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
10 #include "base/task_runner.h" 10 #include "base/task_runner.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 FileStream::Context::OpenResult::OpenResult() { 48 FileStream::Context::OpenResult::OpenResult() {
49 } 49 }
50 50
51 FileStream::Context::OpenResult::OpenResult(base::File file, 51 FileStream::Context::OpenResult::OpenResult(base::File file,
52 IOResult error_code) 52 IOResult error_code)
53 : file(file.Pass()), 53 : file(file.Pass()),
54 error_code(error_code) { 54 error_code(error_code) {
55 } 55 }
56 56
57 FileStream::Context::OpenResult::OpenResult(RValue other) 57 FileStream::Context::OpenResult::OpenResult(OpenResult&& other)
58 : file(other.object->file.Pass()), 58 : file(other.file.Pass()), error_code(other.error_code) {}
59 error_code(other.object->error_code) {
60 }
61 59
62 FileStream::Context::OpenResult& FileStream::Context::OpenResult::operator=( 60 FileStream::Context::OpenResult& FileStream::Context::OpenResult::operator=(
63 RValue other) { 61 OpenResult&& other) {
64 if (this != other.object) { 62 file = other.file.Pass();
65 file = other.object->file.Pass(); 63 error_code = other.error_code;
66 error_code = other.object->error_code;
67 }
68 return *this; 64 return *this;
69 } 65 }
70 66
71 // --------------------------------------------------------------------- 67 // ---------------------------------------------------------------------
72 68
73 void FileStream::Context::Orphan() { 69 void FileStream::Context::Orphan() {
74 DCHECK(!orphaned_); 70 DCHECK(!orphaned_);
75 71
76 orphaned_ = true; 72 orphaned_ = true;
77 73
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // should be reset before Close() because it shouldn't run if any async 229 // should be reset before Close() because it shouldn't run if any async
234 // operation is in progress. 230 // operation is in progress.
235 async_in_progress_ = false; 231 async_in_progress_ = false;
236 if (orphaned_) 232 if (orphaned_)
237 CloseAndDelete(); 233 CloseAndDelete();
238 else 234 else
239 callback.Run(result.result); 235 callback.Run(result.result);
240 } 236 }
241 237
242 } // namespace net 238 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698