| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 const FilePath& DatabaseDirectory() const { return db_dir_; } | 109 const FilePath& DatabaseDirectory() const { return db_dir_; } |
| 110 FilePath GetFullDBFilePath(const string16& origin_identifier, | 110 FilePath GetFullDBFilePath(const string16& origin_identifier, |
| 111 const string16& database_name) const; | 111 const string16& database_name) const; |
| 112 | 112 |
| 113 bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info); | 113 bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info); |
| 114 void SetOriginQuota(const string16& origin_identifier, int64 new_quota); | 114 void SetOriginQuota(const string16& origin_identifier, int64 new_quota); |
| 115 bool DeleteDatabase(const string16& origin_identifier, | 115 bool DeleteDatabase(const string16& origin_identifier, |
| 116 const string16& database_name); | 116 const string16& database_name); |
| 117 bool DeleteOrigin(const string16& origin_identifier); | 117 bool DeleteOrigin(const string16& origin_identifier); |
| 118 | 118 |
| 119 static void ClearLocalState(const FilePath& profile_path, |
| 120 const char* url_scheme_to_be_skipped); |
| 121 |
| 119 private: | 122 private: |
| 120 // Need this here to allow RefCountedThreadSafe to call ~DatabaseTracker(). | 123 // Need this here to allow RefCountedThreadSafe to call ~DatabaseTracker(). |
| 121 friend class base::RefCountedThreadSafe<DatabaseTracker>; | 124 friend class base::RefCountedThreadSafe<DatabaseTracker>; |
| 122 | 125 |
| 123 class CachedOriginInfo : public OriginInfo { | 126 class CachedOriginInfo : public OriginInfo { |
| 124 public: | 127 public: |
| 125 CachedOriginInfo() : OriginInfo(string16(), 0, 0) {} | 128 CachedOriginInfo() : OriginInfo(string16(), 0, 0) {} |
| 126 void SetOrigin(const string16& origin) { origin_ = origin; } | 129 void SetOrigin(const string16& origin) { origin_ = origin; } |
| 127 void SetQuota(int64 new_quota) { quota_ = new_quota; } | 130 void SetQuota(int64 new_quota) { quota_ = new_quota; } |
| 128 void SetDatabaseSize(const string16& database_name, int64 new_size) { | 131 void SetDatabaseSize(const string16& database_name, int64 new_size) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 168 |
| 166 // Default quota for all origins; changed only by tests | 169 // Default quota for all origins; changed only by tests |
| 167 int64 default_quota_; | 170 int64 default_quota_; |
| 168 | 171 |
| 169 FRIEND_TEST(DatabaseTrackerTest, TestIt); | 172 FRIEND_TEST(DatabaseTrackerTest, TestIt); |
| 170 }; | 173 }; |
| 171 | 174 |
| 172 } // namespace webkit_database | 175 } // namespace webkit_database |
| 173 | 176 |
| 174 #endif // WEBKIT_DATABASE_DATABASE_TRACKER_H_ | 177 #endif // WEBKIT_DATABASE_DATABASE_TRACKER_H_ |
| OLD | NEW |