| OLD | NEW |
| 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 #ifndef WEBKIT_FILEAPI_SANDBOX_FILE_STREAM_WRITER_H_ | 5 #ifndef WEBKIT_FILEAPI_SANDBOX_FILE_STREAM_WRITER_H_ |
| 6 #define WEBKIT_FILEAPI_SANDBOX_FILE_STREAM_WRITER_H_ | 6 #define WEBKIT_FILEAPI_SANDBOX_FILE_STREAM_WRITER_H_ |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 SandboxFileStreamWriter(FileSystemContext* file_system_context, | 27 SandboxFileStreamWriter(FileSystemContext* file_system_context, |
| 28 const FileSystemURL& url, | 28 const FileSystemURL& url, |
| 29 int64 initial_offset, | 29 int64 initial_offset, |
| 30 const UpdateObserverList& observers); | 30 const UpdateObserverList& observers); |
| 31 virtual ~SandboxFileStreamWriter(); | 31 virtual ~SandboxFileStreamWriter(); |
| 32 | 32 |
| 33 // FileStreamWriter overrides. | 33 // FileStreamWriter overrides. |
| 34 virtual int Write(net::IOBuffer* buf, int buf_len, | 34 virtual int Write(net::IOBuffer* buf, int buf_len, |
| 35 const net::CompletionCallback& callback) OVERRIDE; | 35 const net::CompletionCallback& callback) OVERRIDE; |
| 36 virtual int Cancel(const net::CompletionCallback& callback) OVERRIDE; | 36 virtual int Cancel(const net::CompletionCallback& callback) OVERRIDE; |
| 37 virtual int Flush(const net::CompletionCallback& callback) OVERRIDE; |
| 37 | 38 |
| 38 // Used only by tests. | 39 // Used only by tests. |
| 39 void set_default_quota(int64 quota) { | 40 void set_default_quota(int64 quota) { |
| 40 default_quota_ = quota; | 41 default_quota_ = quota; |
| 41 } | 42 } |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 // Performs quota calculation and calls local_file_writer_->Write(). | 45 // Performs quota calculation and calls local_file_writer_->Write(). |
| 45 int WriteInternal(net::IOBuffer* buf, int buf_len, | 46 int WriteInternal(net::IOBuffer* buf, int buf_len, |
| 46 const net::CompletionCallback& callback); | 47 const net::CompletionCallback& callback); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 int64 default_quota_; | 82 int64 default_quota_; |
| 82 | 83 |
| 83 base::WeakPtrFactory<SandboxFileStreamWriter> weak_factory_; | 84 base::WeakPtrFactory<SandboxFileStreamWriter> weak_factory_; |
| 84 | 85 |
| 85 DISALLOW_COPY_AND_ASSIGN(SandboxFileStreamWriter); | 86 DISALLOW_COPY_AND_ASSIGN(SandboxFileStreamWriter); |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 } // namespace fileapi | 89 } // namespace fileapi |
| 89 | 90 |
| 90 #endif // WEBKIT_FILEAPI_SANDBOX_FILE_STREAM_WRITER_H_ | 91 #endif // WEBKIT_FILEAPI_SANDBOX_FILE_STREAM_WRITER_H_ |
| OLD | NEW |