OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/fileapi/quota/open_file_handle_context.h" | 5 #include "storage/browser/fileapi/quota/open_file_handle_context.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/file_util.h" |
8 #include "webkit/browser/fileapi/quota/quota_reservation_buffer.h" | 8 #include "storage/browser/fileapi/quota/quota_reservation_buffer.h" |
9 | 9 |
10 namespace storage { | 10 namespace storage { |
11 | 11 |
12 OpenFileHandleContext::OpenFileHandleContext( | 12 OpenFileHandleContext::OpenFileHandleContext( |
13 const base::FilePath& platform_path, | 13 const base::FilePath& platform_path, |
14 QuotaReservationBuffer* reservation_buffer) | 14 QuotaReservationBuffer* reservation_buffer) |
15 : initial_file_size_(0), | 15 : initial_file_size_(0), |
16 maximum_written_offset_(0), | 16 maximum_written_offset_(0), |
17 append_mode_write_amount_(0), | 17 append_mode_write_amount_(0), |
18 platform_path_(platform_path), | 18 platform_path_(platform_path), |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // consumed quota. | 63 // consumed quota. |
64 int64 reserved_quota_consumption = | 64 int64 reserved_quota_consumption = |
65 std::max(GetEstimatedFileSize(), file_size) - initial_file_size_; | 65 std::max(GetEstimatedFileSize(), file_size) - initial_file_size_; |
66 | 66 |
67 reservation_buffer_->CommitFileGrowth( | 67 reservation_buffer_->CommitFileGrowth( |
68 reserved_quota_consumption, usage_delta); | 68 reserved_quota_consumption, usage_delta); |
69 reservation_buffer_->DetachOpenFileHandleContext(this); | 69 reservation_buffer_->DetachOpenFileHandleContext(this); |
70 } | 70 } |
71 | 71 |
72 } // namespace storage | 72 } // namespace storage |
OLD | NEW |