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

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

Issue 323683002: net: FileStream cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add DCHECK, fix ASSERT message Created 6 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 | Annotate | Revision Log
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 MockFileStream, a test class for FileStream. 5 // This file defines MockFileStream, a test class for FileStream.
6 6
7 #ifndef NET_BASE_MOCK_FILE_STREAM_H_ 7 #ifndef NET_BASE_MOCK_FILE_STREAM_H_
8 #define NET_BASE_MOCK_FILE_STREAM_H_ 8 #define NET_BASE_MOCK_FILE_STREAM_H_
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 10 matching lines...) Expand all
21 namespace testing { 21 namespace testing {
22 22
23 class MockFileStream : public net::FileStream { 23 class MockFileStream : public net::FileStream {
24 public: 24 public:
25 explicit MockFileStream(const scoped_refptr<base::TaskRunner>& task_runner); 25 explicit MockFileStream(const scoped_refptr<base::TaskRunner>& task_runner);
26 MockFileStream(base::File file, 26 MockFileStream(base::File file,
27 const scoped_refptr<base::TaskRunner>& task_runner); 27 const scoped_refptr<base::TaskRunner>& task_runner);
28 virtual ~MockFileStream(); 28 virtual ~MockFileStream();
29 29
30 // FileStream methods. 30 // FileStream methods.
31 virtual int Seek(net::Whence whence, int64 offset, 31 virtual int Seek(base::File::Whence whence, int64 offset,
32 const Int64CompletionCallback& callback) OVERRIDE; 32 const Int64CompletionCallback& callback) OVERRIDE;
33 virtual int Read(IOBuffer* buf, 33 virtual int Read(IOBuffer* buf,
34 int buf_len, 34 int buf_len,
35 const CompletionCallback& callback) OVERRIDE; 35 const CompletionCallback& callback) OVERRIDE;
36 virtual int Write(IOBuffer* buf, 36 virtual int Write(IOBuffer* buf,
37 int buf_len, 37 int buf_len,
38 const CompletionCallback& callback) OVERRIDE; 38 const CompletionCallback& callback) OVERRIDE;
39 virtual int Flush(const CompletionCallback& callback) OVERRIDE; 39 virtual int Flush(const CompletionCallback& callback) OVERRIDE;
40 40
41 void set_forced_error_async(int error) { 41 void set_forced_error_async(int error) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 base::FilePath path_; 98 base::FilePath path_;
99 99
100 base::WeakPtrFactory<MockFileStream> weak_factory_; 100 base::WeakPtrFactory<MockFileStream> weak_factory_;
101 }; 101 };
102 102
103 } // namespace testing 103 } // namespace testing
104 104
105 } // namespace net 105 } // namespace net
106 106
107 #endif // NET_BASE_MOCK_FILE_STREAM_H_ 107 #endif // NET_BASE_MOCK_FILE_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698