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

Side by Side Diff: webkit/fileapi/sandbox_file_writer.cc

Issue 10447083: Rename webkit_blob::FileReader to FileStreamReader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge master branch. Created 8 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 #include "webkit/fileapi/sandbox_file_writer.h" 5 #include "webkit/fileapi/sandbox_file_writer.h"
6 6
7 #include "base/file_util_proxy.h" 7 #include "base/file_util_proxy.h"
8 #include "base/platform_file.h" 8 #include "base/platform_file.h"
9 #include "base/sequenced_task_runner.h" 9 #include "base/sequenced_task_runner.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
11 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
12 #include "webkit/blob/local_file_reader.h" 12 #include "webkit/blob/local_file_stream_reader.h"
13 #include "webkit/fileapi/file_system_context.h" 13 #include "webkit/fileapi/file_system_context.h"
14 #include "webkit/fileapi/file_system_operation_interface.h" 14 #include "webkit/fileapi/file_system_operation_interface.h"
15 #include "webkit/fileapi/file_system_quota_util.h" 15 #include "webkit/fileapi/file_system_quota_util.h"
16 #include "webkit/fileapi/file_system_util.h" 16 #include "webkit/fileapi/file_system_util.h"
17 #include "webkit/fileapi/local_file_writer.h" 17 #include "webkit/fileapi/local_file_writer.h"
18 #include "webkit/quota/quota_manager.h" 18 #include "webkit/quota/quota_manager.h"
19 19
20 namespace fileapi { 20 namespace fileapi {
21 21
22 namespace { 22 namespace {
23 23
24 int PlatformFileErrorToNetError(base::PlatformFileError error) { 24 int PlatformFileErrorToNetError(base::PlatformFileError error) {
25 // TODO(kinuko): Move this static method to more convenient place. 25 // TODO(kinuko): Move this static method to more convenient place.
26 return webkit_blob::LocalFileReader::PlatformFileErrorToNetError(error); 26 return webkit_blob::LocalFileStreamReader::PlatformFileErrorToNetError(error);
27 } 27 }
28 28
29 // Adjust the |quota| value in overwriting case (i.e. |file_size| > 0 and 29 // Adjust the |quota| value in overwriting case (i.e. |file_size| > 0 and
30 // |file_offset| < |file_size|) to make the remaining quota calculation easier. 30 // |file_offset| < |file_size|) to make the remaining quota calculation easier.
31 // Specifically this widens the quota for overlapping range (so that we can 31 // Specifically this widens the quota for overlapping range (so that we can
32 // simply compare written bytes against the adjusted quota). 32 // simply compare written bytes against the adjusted quota).
33 int64 AdjustQuotaForOverlap(int64 quota, 33 int64 AdjustQuotaForOverlap(int64 quota,
34 int64 file_offset, 34 int64 file_offset,
35 int64 file_size) { 35 int64 file_size) {
36 DCHECK_LE(file_offset, file_size); 36 DCHECK_LE(file_offset, file_size);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 pending_cancel.Run(net::OK); 239 pending_cancel.Run(net::OK);
240 return true; 240 return true;
241 } 241 }
242 242
243 FileSystemQuotaUtil* SandboxFileWriter::quota_util() const { 243 FileSystemQuotaUtil* SandboxFileWriter::quota_util() const {
244 DCHECK(file_system_context_.get()); 244 DCHECK(file_system_context_.get());
245 return file_system_context_->GetQuotaUtil(file_system_type_); 245 return file_system_context_->GetQuotaUtil(file_system_type_);
246 } 246 }
247 247
248 } // namespace fileapi 248 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/isolated_mount_point_provider.cc ('k') | webkit/fileapi/sandbox_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698