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

Side by Side Diff: storage/browser/fileapi/quota/open_file_handle.h

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 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 #ifndef WEBKIT_BROWSER_FILEAPI_QUOTA_OPEN_FILE_HANDLE_H_ 5 #ifndef WEBKIT_BROWSER_FILEAPI_QUOTA_OPEN_FILE_HANDLE_H_
6 #define WEBKIT_BROWSER_FILEAPI_QUOTA_OPEN_FILE_HANDLE_H_ 6 #define WEBKIT_BROWSER_FILEAPI_QUOTA_OPEN_FILE_HANDLE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "webkit/browser/webkit_storage_browser_export.h" 11 #include "storage/common/storage_export.h"
12 12
13 namespace base { 13 namespace base {
14 class FilePath; 14 class FilePath;
15 } 15 }
16 16
17 namespace fileapi { 17 namespace storage {
18 18
19 class QuotaReservation; 19 class QuotaReservation;
20 class OpenFileHandleContext; 20 class OpenFileHandleContext;
21 class QuotaReservationBuffer; 21 class QuotaReservationBuffer;
22 22
23 // Represents an open file like a file descriptor. 23 // Represents an open file like a file descriptor.
24 // This should be alive while a consumer keeps a file opened and should be 24 // This should be alive while a consumer keeps a file opened and should be
25 // deleted when the plugin closes the file. 25 // deleted when the plugin closes the file.
26 class WEBKIT_STORAGE_BROWSER_EXPORT OpenFileHandle { 26 class STORAGE_EXPORT OpenFileHandle {
27 public: 27 public:
28 ~OpenFileHandle(); 28 ~OpenFileHandle();
29 29
30 // Updates cached file size and consumes quota for that. 30 // Updates cached file size and consumes quota for that.
31 // Both this and AddAppendModeWriteAmount should be called for each modified 31 // Both this and AddAppendModeWriteAmount should be called for each modified
32 // file before calling QuotaReservation::RefreshQuota and before closing the 32 // file before calling QuotaReservation::RefreshQuota and before closing the
33 // file. 33 // file.
34 void UpdateMaxWrittenOffset(int64 offset); 34 void UpdateMaxWrittenOffset(int64 offset);
35 35
36 // Notifies that |amount| of data is written to the file in append mode, and 36 // Notifies that |amount| of data is written to the file in append mode, and
(...skipping 10 matching lines...) Expand all
47 // all clients report their file usage, and is monotonically increasing over 47 // all clients report their file usage, and is monotonically increasing over
48 // OpenFileHandle object life cycle, so that client may cache the value. 48 // OpenFileHandle object life cycle, so that client may cache the value.
49 int64 GetEstimatedFileSize() const; 49 int64 GetEstimatedFileSize() const;
50 50
51 int64 GetMaxWrittenOffset() const; 51 int64 GetMaxWrittenOffset() const;
52 const base::FilePath& platform_path() const; 52 const base::FilePath& platform_path() const;
53 53
54 private: 54 private:
55 friend class QuotaReservationBuffer; 55 friend class QuotaReservationBuffer;
56 56
57 OpenFileHandle(QuotaReservation* reservation, 57 OpenFileHandle(QuotaReservation* reservation, OpenFileHandleContext* context);
58 OpenFileHandleContext* context);
59 58
60 scoped_refptr<QuotaReservation> reservation_; 59 scoped_refptr<QuotaReservation> reservation_;
61 scoped_refptr<OpenFileHandleContext> context_; 60 scoped_refptr<OpenFileHandleContext> context_;
62 61
63 base::SequenceChecker sequence_checker_; 62 base::SequenceChecker sequence_checker_;
64 63
65 DISALLOW_COPY_AND_ASSIGN(OpenFileHandle); 64 DISALLOW_COPY_AND_ASSIGN(OpenFileHandle);
66 }; 65 };
67 66
68 } // namespace fileapi 67 } // namespace storage
69 68
70 #endif // WEBKIT_BROWSER_FILEAPI_QUOTA_OPEN_FILE_HANDLE_H_ 69 #endif // WEBKIT_BROWSER_FILEAPI_QUOTA_OPEN_FILE_HANDLE_H_
OLDNEW
« no previous file with comments | « storage/browser/fileapi/plugin_private_file_system_backend.cc ('k') | storage/browser/fileapi/quota/open_file_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698