| OLD | NEW |
| 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 15 matching lines...) Expand all Loading... |
| 35 virtual ~FileSystemOperationContext(); | 36 virtual ~FileSystemOperationContext(); |
| 36 | 37 |
| 37 FileSystemContext* file_system_context() const { | 38 FileSystemContext* file_system_context() const { |
| 38 return file_system_context_; | 39 return file_system_context_; |
| 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 } |
| 46 void set_quota_limit_type(quota::QuotaLimitType limit_type) { |
| 47 quota_limit_type_ = limit_type; |
| 48 } |
| 45 | 49 |
| 46 // Returns the current remaining quota. | 50 // Returns the current remaining quota. |
| 47 int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } | 51 int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } |
| 48 | 52 |
| 53 quota::QuotaLimitType quota_limit_type() const { |
| 54 return quota_limit_type_; |
| 55 } |
| 56 |
| 49 // Returns TaskRunner which the operation is performed on. | 57 // Returns TaskRunner which the operation is performed on. |
| 50 base::SequencedTaskRunner* task_runner() const { | 58 base::SequencedTaskRunner* task_runner() const { |
| 51 return task_runner_.get(); | 59 return task_runner_.get(); |
| 52 } | 60 } |
| 53 | 61 |
| 54 ChangeObserverList* change_observers() { return &change_observers_; } | 62 ChangeObserverList* change_observers() { return &change_observers_; } |
| 55 AccessObserverList* access_observers() { return &access_observers_; } | 63 AccessObserverList* access_observers() { return &access_observers_; } |
| 56 UpdateObserverList* update_observers() { return &update_observers_; } | 64 UpdateObserverList* update_observers() { return &update_observers_; } |
| 57 | 65 |
| 58 // Gets and sets value-type (or not-owned) variable as UserData. | 66 // Gets and sets value-type (or not-owned) variable as UserData. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 access_observers_ = list; | 103 access_observers_ = list; |
| 96 } | 104 } |
| 97 void set_update_observers(const UpdateObserverList& list) { | 105 void set_update_observers(const UpdateObserverList& list) { |
| 98 update_observers_ = list; | 106 update_observers_ = list; |
| 99 } | 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_ |
| OLD | NEW |