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

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

Issue 1148383003: Only support seeking file streams from the beginning of the file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Win DBG build by Pass()-ing file out of CreateForAsyncHandle. Created 5 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 | « net/base/file_stream_unittest.cc ('k') | net/base/mock_file_stream.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 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 FileStream { 23 class MockFileStream : public 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 ~MockFileStream() override; 28 ~MockFileStream() override;
29 29
30 // FileStream methods. 30 // FileStream methods.
31 int Seek(base::File::Whence whence, 31 int Seek(int64_t offset, const Int64CompletionCallback& callback) override;
32 int64_t offset,
33 const Int64CompletionCallback& callback) override;
34 int Read(IOBuffer* buf, 32 int Read(IOBuffer* buf,
35 int buf_len, 33 int buf_len,
36 const CompletionCallback& callback) override; 34 const CompletionCallback& callback) override;
37 int Write(IOBuffer* buf, 35 int Write(IOBuffer* buf,
38 int buf_len, 36 int buf_len,
39 const CompletionCallback& callback) override; 37 const CompletionCallback& callback) override;
40 int Flush(const CompletionCallback& callback) override; 38 int Flush(const CompletionCallback& callback) override;
41 39
42 void set_forced_error_async(int error) { 40 void set_forced_error_async(int error) {
43 forced_error_ = error; 41 forced_error_ = error;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 base::FilePath path_; 97 base::FilePath path_;
100 98
101 base::WeakPtrFactory<MockFileStream> weak_factory_; 99 base::WeakPtrFactory<MockFileStream> weak_factory_;
102 }; 100 };
103 101
104 } // namespace testing 102 } // namespace testing
105 103
106 } // namespace net 104 } // namespace net
107 105
108 #endif // NET_BASE_MOCK_FILE_STREAM_H_ 106 #endif // NET_BASE_MOCK_FILE_STREAM_H_
OLDNEW
« no previous file with comments | « net/base/file_stream_unittest.cc ('k') | net/base/mock_file_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698