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

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

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 | « net/base/directory_lister.cc ('k') | net/base/file_stream_context.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 // 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.h" 5 #include "net/base/file_stream.h"
6 6
7 #include <utility>
8
7 #include "base/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
8 #include "net/base/file_stream_context.h" 10 #include "net/base/file_stream_context.h"
9 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
10 12
11 namespace net { 13 namespace net {
12 14
13 FileStream::FileStream(const scoped_refptr<base::TaskRunner>& task_runner) 15 FileStream::FileStream(const scoped_refptr<base::TaskRunner>& task_runner)
14 : context_(new Context(task_runner)) { 16 : context_(new Context(task_runner)) {
15 } 17 }
16 18
17 FileStream::FileStream(base::File file, 19 FileStream::FileStream(base::File file,
18 const scoped_refptr<base::TaskRunner>& task_runner) 20 const scoped_refptr<base::TaskRunner>& task_runner)
19 : context_(new Context(file.Pass(), task_runner)) { 21 : context_(new Context(std::move(file), task_runner)) {}
20 }
21 22
22 FileStream::~FileStream() { 23 FileStream::~FileStream() {
23 context_.release()->Orphan(); 24 context_.release()->Orphan();
24 } 25 }
25 26
26 int FileStream::Open(const base::FilePath& path, int open_flags, 27 int FileStream::Open(const base::FilePath& path, int open_flags,
27 const CompletionCallback& callback) { 28 const CompletionCallback& callback) {
28 if (IsOpen()) { 29 if (IsOpen()) {
29 DLOG(FATAL) << "File is already open!"; 30 DLOG(FATAL) << "File is already open!";
30 return ERR_UNEXPECTED; 31 return ERR_UNEXPECTED;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 81
81 int FileStream::Flush(const CompletionCallback& callback) { 82 int FileStream::Flush(const CompletionCallback& callback) {
82 if (!IsOpen()) 83 if (!IsOpen())
83 return ERR_UNEXPECTED; 84 return ERR_UNEXPECTED;
84 85
85 context_->Flush(callback); 86 context_->Flush(callback);
86 return ERR_IO_PENDING; 87 return ERR_IO_PENDING;
87 } 88 }
88 89
89 } // namespace net 90 } // namespace net
OLDNEW
« no previous file with comments | « net/base/directory_lister.cc ('k') | net/base/file_stream_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698