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

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

Issue 19614003: Use a direct include of the message_loop header in net/, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « net/base/dns_reloader.cc ('k') | net/base/file_stream_unittest.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 // 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
11 // to be able to do and finish all async operations even when FileStream 11 // to be able to do and finish all async operations even when FileStream
12 // instance is deleted. So FileStream's destructor can schedule file 12 // instance is deleted. So FileStream's destructor can schedule file
13 // closing to be done by Context in WorkerPool (or the TaskRunner passed to 13 // closing to be done by Context in WorkerPool (or the TaskRunner passed to
14 // constructor) and then just return (releasing Context pointer from 14 // constructor) and then just return (releasing Context pointer from
15 // scoped_ptr) without waiting for actual closing to complete. 15 // scoped_ptr) without waiting for actual closing to complete.
16 // Implementation of FileStream::Context is divided in two parts: some methods 16 // Implementation of FileStream::Context is divided in two parts: some methods
17 // and members are platform-independent and some depend on the platform. This 17 // and members are platform-independent and some depend on the platform. This
18 // header file contains the complete definition of Context class including all 18 // header file contains the complete definition of Context class including all
19 // platform-dependent parts (because of that it has a lot of #if-#else 19 // platform-dependent parts (because of that it has a lot of #if-#else
20 // branching). Implementations of all platform-independent methods are 20 // branching). Implementations of all platform-independent methods are
21 // located in file_stream_context.cc, and all platform-dependent methods are 21 // located in file_stream_context.cc, and all platform-dependent methods are
22 // in file_stream_context_{win,posix}.cc. This separation provides better 22 // in file_stream_context_{win,posix}.cc. This separation provides better
23 // readability of Context's code. And we tried to make as much Context code 23 // readability of Context's code. And we tried to make as much Context code
24 // platform-independent as possible. So file_stream_context_{win,posix}.cc are 24 // platform-independent as possible. So file_stream_context_{win,posix}.cc are
25 // much smaller than file_stream_context.cc now. 25 // much smaller than file_stream_context.cc now.
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 "base/message_loop.h" 30 #include "base/message_loop/message_loop.h"
31 #include "base/platform_file.h" 31 #include "base/platform_file.h"
32 #include "base/task_runner.h" 32 #include "base/task_runner.h"
33 #include "net/base/completion_callback.h" 33 #include "net/base/completion_callback.h"
34 #include "net/base/file_stream.h" 34 #include "net/base/file_stream.h"
35 #include "net/base/file_stream_metrics.h" 35 #include "net/base/file_stream_metrics.h"
36 #include "net/base/file_stream_whence.h" 36 #include "net/base/file_stream_whence.h"
37 #include "net/base/net_log.h" 37 #include "net/base/net_log.h"
38 38
39 #if defined(OS_POSIX) 39 #if defined(OS_POSIX)
40 #include <errno.h> 40 #include <errno.h>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 FileErrorSource error_source_; 223 FileErrorSource error_source_;
224 #endif 224 #endif
225 225
226 DISALLOW_COPY_AND_ASSIGN(Context); 226 DISALLOW_COPY_AND_ASSIGN(Context);
227 }; 227 };
228 228
229 } // namespace net 229 } // namespace net
230 230
231 #endif // NET_BASE_FILE_STREAM_CONTEXT_H_ 231 #endif // NET_BASE_FILE_STREAM_CONTEXT_H_
232 232
OLDNEW
« no previous file with comments | « net/base/dns_reloader.cc ('k') | net/base/file_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698