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

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

Issue 2047633002: Revert of Remove base/move.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « mojo/public/cpp/system/handle.h ('k') | remoting/base/typed_buffer.h » ('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 // This file defines FileStream::Context class. 5 // This file defines FileStream::Context class.
6 // The general design of FileStream is as follows: file_stream.h defines 6 // The general design of FileStream is as follows: file_stream.h defines
7 // FileStream class which basically is just an "wrapper" not containing any 7 // FileStream class which basically is just an "wrapper" not containing any
8 // specific implementation details. It re-routes all its method calls to 8 // specific implementation details. It re-routes all its method calls to
9 // the instance of FileStream::Context (FileStream holds a scoped_ptr to 9 // the instance of FileStream::Context (FileStream holds a scoped_ptr to
10 // FileStream::Context instance). Context was extracted into a different class 10 // FileStream::Context instance). Context was extracted into a different class
(...skipping 15 matching lines...) Expand all
26 26
27 #ifndef NET_BASE_FILE_STREAM_CONTEXT_H_ 27 #ifndef NET_BASE_FILE_STREAM_CONTEXT_H_
28 #define NET_BASE_FILE_STREAM_CONTEXT_H_ 28 #define NET_BASE_FILE_STREAM_CONTEXT_H_
29 29
30 #include <stdint.h> 30 #include <stdint.h>
31 31
32 #include "base/files/file.h" 32 #include "base/files/file.h"
33 #include "base/macros.h" 33 #include "base/macros.h"
34 #include "base/memory/weak_ptr.h" 34 #include "base/memory/weak_ptr.h"
35 #include "base/message_loop/message_loop.h" 35 #include "base/message_loop/message_loop.h"
36 #include "base/move.h"
36 #include "base/single_thread_task_runner.h" 37 #include "base/single_thread_task_runner.h"
37 #include "base/task_runner.h" 38 #include "base/task_runner.h"
38 #include "net/base/completion_callback.h" 39 #include "net/base/completion_callback.h"
39 #include "net/base/file_stream.h" 40 #include "net/base/file_stream.h"
40 41
41 #if defined(OS_POSIX) 42 #if defined(OS_POSIX)
42 #include <errno.h> 43 #include <errno.h>
43 #endif 44 #endif
44 45
45 namespace base { 46 namespace base {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 struct IOResult { 106 struct IOResult {
106 IOResult(); 107 IOResult();
107 IOResult(int64_t result, logging::SystemErrorCode os_error); 108 IOResult(int64_t result, logging::SystemErrorCode os_error);
108 static IOResult FromOSError(logging::SystemErrorCode os_error); 109 static IOResult FromOSError(logging::SystemErrorCode os_error);
109 110
110 int64_t result; 111 int64_t result;
111 logging::SystemErrorCode os_error; // Set only when result < 0. 112 logging::SystemErrorCode os_error; // Set only when result < 0.
112 }; 113 };
113 114
114 struct OpenResult { 115 struct OpenResult {
116 MOVE_ONLY_TYPE_FOR_CPP_03(OpenResult)
115 public: 117 public:
116 OpenResult(); 118 OpenResult();
117 OpenResult(base::File file, IOResult error_code); 119 OpenResult(base::File file, IOResult error_code);
118 OpenResult(OpenResult&& other); 120 OpenResult(OpenResult&& other);
119 OpenResult& operator=(OpenResult&& other); 121 OpenResult& operator=(OpenResult&& other);
120 122
121 base::File file; 123 base::File file;
122 IOResult error_code; 124 IOResult error_code;
123
124 private:
125 DISALLOW_COPY_AND_ASSIGN(OpenResult);
126 }; 125 };
127 126
128 //////////////////////////////////////////////////////////////////////////// 127 ////////////////////////////////////////////////////////////////////////////
129 // Platform-independent methods implemented in file_stream_context.cc. 128 // Platform-independent methods implemented in file_stream_context.cc.
130 //////////////////////////////////////////////////////////////////////////// 129 ////////////////////////////////////////////////////////////////////////////
131 130
132 OpenResult OpenFileImpl(const base::FilePath& path, int open_flags); 131 OpenResult OpenFileImpl(const base::FilePath& path, int open_flags);
133 132
134 IOResult CloseFileImpl(); 133 IOResult CloseFileImpl();
135 134
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // Tracks the result of the IO completion operation. Set in OnIOComplete. 236 // Tracks the result of the IO completion operation. Set in OnIOComplete.
238 int result_; 237 int result_;
239 #endif 238 #endif
240 239
241 DISALLOW_COPY_AND_ASSIGN(Context); 240 DISALLOW_COPY_AND_ASSIGN(Context);
242 }; 241 };
243 242
244 } // namespace net 243 } // namespace net
245 244
246 #endif // NET_BASE_FILE_STREAM_CONTEXT_H_ 245 #endif // NET_BASE_FILE_STREAM_CONTEXT_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/system/handle.h ('k') | remoting/base/typed_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698