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

Side by Side Diff: webkit/database/database_tracker.h

Issue 7037018: DB quota (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_DATABASE_DATABASE_TRACKER_H_ 5 #ifndef WEBKIT_DATABASE_DATABASE_TRACKER_H_
6 #define WEBKIT_DATABASE_DATABASE_TRACKER_H_ 6 #define WEBKIT_DATABASE_DATABASE_TRACKER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 const FilePath& DatabaseDirectory() const { return db_dir_; } 118 const FilePath& DatabaseDirectory() const { return db_dir_; }
119 FilePath GetFullDBFilePath(const string16& origin_identifier, 119 FilePath GetFullDBFilePath(const string16& origin_identifier,
120 const string16& database_name); 120 const string16& database_name);
121 121
122 // virtual for unittesting only 122 // virtual for unittesting only
123 virtual bool GetOriginInfo(const string16& origin_id, OriginInfo* info); 123 virtual bool GetOriginInfo(const string16& origin_id, OriginInfo* info);
124 virtual bool GetAllOriginIdentifiers(std::vector<string16>* origin_ids); 124 virtual bool GetAllOriginIdentifiers(std::vector<string16>* origin_ids);
125 virtual bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info); 125 virtual bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info);
126 126
127 // TODO(michaeln): remove quota related stuff when quota manager
128 // integration is complete
127 void SetOriginQuota(const string16& origin_identifier, int64 new_quota); 129 void SetOriginQuota(const string16& origin_identifier, int64 new_quota);
128 int64 GetDefaultQuota() { return default_quota_; } 130 int64 GetDefaultQuota() { return default_quota_; }
129 // Sets the default quota for all origins. Should be used in tests only. 131 void SetDefaultQuota(int64 quota); // for testing
130 void SetDefaultQuota(int64 quota); 132
133 // Safe to call on any thread.
134 quota::QuotaManagerProxy* quota_manager_proxy() const {
135 return quota_manager_proxy_.get();
136 }
131 137
132 bool IsDatabaseScheduledForDeletion(const string16& origin_identifier, 138 bool IsDatabaseScheduledForDeletion(const string16& origin_identifier,
133 const string16& database_name); 139 const string16& database_name);
134 140
135 // Deletes a single database. Returns net::OK on success, net::FAILED on 141 // Deletes a single database. Returns net::OK on success, net::FAILED on
136 // failure, or net::ERR_IO_PENDING and |callback| is invoked upon completion, 142 // failure, or net::ERR_IO_PENDING and |callback| is invoked upon completion,
137 // if non-NULL. 143 // if non-NULL.
138 int DeleteDatabase(const string16& origin_identifier, 144 int DeleteDatabase(const string16& origin_identifier,
139 const string16& database_name, 145 const string16& database_name,
140 net::CompletionCallback* callback); 146 net::CompletionCallback* callback);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // this map to assign directory names that do not reveal this information. 276 // this map to assign directory names that do not reveal this information.
271 OriginDirectoriesMap incognito_origin_directories_; 277 OriginDirectoriesMap incognito_origin_directories_;
272 int incognito_origin_directories_generator_; 278 int incognito_origin_directories_generator_;
273 279
274 FRIEND_TEST_ALL_PREFIXES(DatabaseTracker, TestHelper); 280 FRIEND_TEST_ALL_PREFIXES(DatabaseTracker, TestHelper);
275 }; 281 };
276 282
277 } // namespace webkit_database 283 } // namespace webkit_database
278 284
279 #endif // WEBKIT_DATABASE_DATABASE_TRACKER_H_ 285 #endif // WEBKIT_DATABASE_DATABASE_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698