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

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

Issue 11030044: Merge 159454 - Flush at the end of local file writing in FileWriter API. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 years, 2 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/file_stream_win.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 25 matching lines...) Expand all
36 virtual int Read(IOBuffer* buf, 36 virtual int Read(IOBuffer* buf,
37 int buf_len, 37 int buf_len,
38 const CompletionCallback& callback) OVERRIDE; 38 const CompletionCallback& callback) OVERRIDE;
39 virtual int ReadSync(char* buf, int buf_len) OVERRIDE; 39 virtual int ReadSync(char* buf, int buf_len) OVERRIDE;
40 virtual int ReadUntilComplete(char *buf, int buf_len) OVERRIDE; 40 virtual int ReadUntilComplete(char *buf, int buf_len) OVERRIDE;
41 virtual int Write(IOBuffer* buf, 41 virtual int Write(IOBuffer* buf,
42 int buf_len, 42 int buf_len,
43 const CompletionCallback& callback) OVERRIDE; 43 const CompletionCallback& callback) OVERRIDE;
44 virtual int WriteSync(const char* buf, int buf_len) OVERRIDE; 44 virtual int WriteSync(const char* buf, int buf_len) OVERRIDE;
45 virtual int64 Truncate(int64 bytes) OVERRIDE; 45 virtual int64 Truncate(int64 bytes) OVERRIDE;
46 virtual int Flush() OVERRIDE; 46 virtual int Flush(const CompletionCallback& callback) OVERRIDE;
47 virtual int FlushSync() OVERRIDE;
47 48
48 void set_forced_error(int error) { forced_error_ = error; } 49 void set_forced_error(int error) { forced_error_ = error; }
49 void clear_forced_error() { forced_error_ = net::OK; } 50 void clear_forced_error() { forced_error_ = net::OK; }
50 int forced_error() const { return forced_error_; } 51 int forced_error() const { return forced_error_; }
51 const FilePath& get_path() const { return path_; } 52 const FilePath& get_path() const { return path_; }
52 53
53 private: 54 private:
54 int ReturnError(int function_error) { 55 int ReturnError(int function_error) {
55 if (forced_error_ != net::OK) { 56 if (forced_error_ != net::OK) {
56 int ret = forced_error_; 57 int ret = forced_error_;
(...skipping 16 matching lines...) Expand all
73 74
74 int forced_error_; 75 int forced_error_;
75 FilePath path_; 76 FilePath path_;
76 }; 77 };
77 78
78 } // namespace testing 79 } // namespace testing
79 80
80 } // namespace net 81 } // namespace net
81 82
82 #endif // NET_BASE_MOCK_FILE_STREAM_H_ 83 #endif // NET_BASE_MOCK_FILE_STREAM_H_
OLDNEW
« no previous file with comments | « net/base/file_stream_win.cc ('k') | net/base/mock_file_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698