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

Side by Side Diff: webkit/fileapi/file_system_operation_context.h

Issue 14265022: [Quota][FileAPI] Add quota policy to FileSystemOperationContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add special storage policy Created 7 years, 7 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
« no previous file with comments | « webkit/fileapi/file_system_context.cc ('k') | webkit/fileapi/file_system_operation_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_
7 7
8 #include "base/supports_user_data.h" 8 #include "base/supports_user_data.h"
9 #include "webkit/fileapi/task_runner_bound_observer_list.h" 9 #include "webkit/fileapi/task_runner_bound_observer_list.h"
10 #include "webkit/quota/quota_types.h"
10 #include "webkit/storage/webkit_storage_export.h" 11 #include "webkit/storage/webkit_storage_export.h"
11 12
12 namespace base { 13 namespace base {
13 class SequencedTaskRunner; 14 class SequencedTaskRunner;
14 } 15 }
15 16
16 namespace fileapi { 17 namespace fileapi {
17 18
18 class FileSystemContext; 19 class FileSystemContext;
19 20
(...skipping 19 matching lines...) Expand all
39 } 40 }
40 41
41 // Updates the current remaining quota. 42 // Updates the current remaining quota.
42 void set_allowed_bytes_growth(const int64& allowed_bytes_growth) { 43 void set_allowed_bytes_growth(const int64& allowed_bytes_growth) {
43 allowed_bytes_growth_ = allowed_bytes_growth; 44 allowed_bytes_growth_ = allowed_bytes_growth;
44 } 45 }
45 46
46 // Returns the current remaining quota. 47 // Returns the current remaining quota.
47 int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } 48 int64 allowed_bytes_growth() const { return allowed_bytes_growth_; }
48 49
50 quota::QuotaLimitType quota_limit_type() const {
51 return quota_limit_type_;
52 }
53
49 // Returns TaskRunner which the operation is performed on. 54 // Returns TaskRunner which the operation is performed on.
50 base::SequencedTaskRunner* task_runner() const { 55 base::SequencedTaskRunner* task_runner() const {
51 return task_runner_.get(); 56 return task_runner_.get();
52 } 57 }
53 58
54 ChangeObserverList* change_observers() { return &change_observers_; } 59 ChangeObserverList* change_observers() { return &change_observers_; }
55 AccessObserverList* access_observers() { return &access_observers_; } 60 AccessObserverList* access_observers() { return &access_observers_; }
56 UpdateObserverList* update_observers() { return &update_observers_; } 61 UpdateObserverList* update_observers() { return &update_observers_; }
57 62
58 // Gets and sets value-type (or not-owned) variable as UserData. 63 // Gets and sets value-type (or not-owned) variable as UserData.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 95
91 void set_change_observers(const ChangeObserverList& list) { 96 void set_change_observers(const ChangeObserverList& list) {
92 change_observers_ = list; 97 change_observers_ = list;
93 } 98 }
94 void set_access_observers(const AccessObserverList& list) { 99 void set_access_observers(const AccessObserverList& list) {
95 access_observers_ = list; 100 access_observers_ = list;
96 } 101 }
97 void set_update_observers(const UpdateObserverList& list) { 102 void set_update_observers(const UpdateObserverList& list) {
98 update_observers_ = list; 103 update_observers_ = list;
99 } 104 }
105 void set_quota_limit_type(quota::QuotaLimitType limit_type) {
106 quota_limit_type_ = limit_type;
107 }
100 108
101 FileSystemContext* file_system_context_; 109 FileSystemContext* file_system_context_;
102 scoped_refptr<base::SequencedTaskRunner> task_runner_; 110 scoped_refptr<base::SequencedTaskRunner> task_runner_;
103 111
104 int64 allowed_bytes_growth_; 112 int64 allowed_bytes_growth_;
113 quota::QuotaLimitType quota_limit_type_;
105 114
106 AccessObserverList access_observers_; 115 AccessObserverList access_observers_;
107 ChangeObserverList change_observers_; 116 ChangeObserverList change_observers_;
108 UpdateObserverList update_observers_; 117 UpdateObserverList update_observers_;
109 118
110 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationContext); 119 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationContext);
111 }; 120 };
112 121
113 } // namespace fileapi 122 } // namespace fileapi
114 123
115 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ 124 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_context.cc ('k') | webkit/fileapi/file_system_operation_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698