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

Side by Side Diff: webkit/browser/fileapi/quota/open_file_handle.cc

Issue 539143002: Migrate webkit/browser/ to storage/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android build Created 6 years, 3 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
OLDNEW
(Empty)
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.
4
5 #include "webkit/browser/fileapi/quota/open_file_handle.h"
6
7 #include "webkit/browser/fileapi/quota/open_file_handle_context.h"
8 #include "webkit/browser/fileapi/quota/quota_reservation.h"
9
10 namespace storage {
11
12 OpenFileHandle::~OpenFileHandle() {
13 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
14 }
15
16 void OpenFileHandle::UpdateMaxWrittenOffset(int64 offset) {
17 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
18
19 int64 growth = context_->UpdateMaxWrittenOffset(offset);
20 if (growth > 0)
21 reservation_->ConsumeReservation(growth);
22 }
23
24 void OpenFileHandle::AddAppendModeWriteAmount(int64 amount) {
25 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
26 if (amount <= 0)
27 return;
28
29 context_->AddAppendModeWriteAmount(amount);
30 reservation_->ConsumeReservation(amount);
31 }
32
33 int64 OpenFileHandle::GetEstimatedFileSize() const {
34 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
35 return context_->GetEstimatedFileSize();
36 }
37
38 int64 OpenFileHandle::GetMaxWrittenOffset() const {
39 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
40 return context_->GetMaxWrittenOffset();
41 }
42
43 const base::FilePath& OpenFileHandle::platform_path() const {
44 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
45 return context_->platform_path();
46 }
47
48 OpenFileHandle::OpenFileHandle(QuotaReservation* reservation,
49 OpenFileHandleContext* context)
50 : reservation_(reservation),
51 context_(context) {
52 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
53 }
54
55 } // namespace storage
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/quota/open_file_handle.h ('k') | webkit/browser/fileapi/quota/open_file_handle_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698