net cleanup: Remove unnecessary namespace prefixes.
[chromium-blink-merge.git] / storage / browser / fileapi / quota / open_file_handle.cc
blob88424381d34400480b32f502e0ef0d6e3b6607e3
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
3 // found in the LICENSE file.
5 #include "storage/browser/fileapi/quota/open_file_handle.h"
7 #include "storage/browser/fileapi/quota/open_file_handle_context.h"
8 #include "storage/browser/fileapi/quota/quota_reservation.h"
10 namespace storage {
12 OpenFileHandle::~OpenFileHandle() {
13 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
16 void OpenFileHandle::UpdateMaxWrittenOffset(int64 offset) {
17 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
19 int64 growth = context_->UpdateMaxWrittenOffset(offset);
20 if (growth > 0)
21 reservation_->ConsumeReservation(growth);
24 void OpenFileHandle::AddAppendModeWriteAmount(int64 amount) {
25 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
26 if (amount <= 0)
27 return;
29 context_->AddAppendModeWriteAmount(amount);
30 reservation_->ConsumeReservation(amount);
33 int64 OpenFileHandle::GetEstimatedFileSize() const {
34 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
35 return context_->GetEstimatedFileSize();
38 int64 OpenFileHandle::GetMaxWrittenOffset() const {
39 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
40 return context_->GetMaxWrittenOffset();
43 const base::FilePath& OpenFileHandle::platform_path() const {
44 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
45 return context_->platform_path();
48 OpenFileHandle::OpenFileHandle(QuotaReservation* reservation,
49 OpenFileHandleContext* context)
50 : reservation_(reservation),
51 context_(context) {
52 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
55 } // namespace storage