| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class Database; | 41 class Database; |
| 42 class OriginUsageRecord; | 42 class OriginUsageRecord; |
| 43 | 43 |
| 44 class OriginQuotaManager : public Noncopyable { | 44 class OriginQuotaManager : public Noncopyable { |
| 45 public: | 45 public: |
| 46 OriginQuotaManager(); | 46 OriginQuotaManager(); |
| 47 | 47 |
| 48 bool tryLock(); |
| 48 void lock(); | 49 void lock(); |
| 49 void unlock(); | 50 void unlock(); |
| 50 | 51 |
| 51 void trackOrigin(PassRefPtr<SecurityOrigin>); | 52 void trackOrigin(PassRefPtr<SecurityOrigin>); |
| 52 bool tracksOrigin(SecurityOrigin*) const; | 53 bool tracksOrigin(SecurityOrigin*) const; |
| 53 void addDatabase(SecurityOrigin*, const String& databaseIdentifier, const St
ring& fullPath); | 54 void addDatabase(SecurityOrigin*, const String& databaseIdentifier, const St
ring& fullPath); |
| 54 void removeDatabase(SecurityOrigin*, const String& databaseIdentifier); | 55 void removeDatabase(SecurityOrigin*, const String& databaseIdentifier); |
| 55 void removeOrigin(SecurityOrigin*); | 56 void removeOrigin(SecurityOrigin*); |
| 56 | 57 |
| 57 void markDatabase(Database*); // Mark dirtiness of a specific database. | 58 void markDatabase(Database*); // Mark dirtiness of a specific database. |
| 58 unsigned long long diskUsage(SecurityOrigin*) const; | 59 unsigned long long diskUsage(SecurityOrigin*) const; |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 mutable Mutex m_usageRecordGuard; | 62 mutable Mutex m_usageRecordGuard; |
| 62 #ifndef NDEBUG | 63 #ifndef NDEBUG |
| 63 bool m_usageRecordGuardLocked; | 64 bool m_usageRecordGuardLocked; |
| 64 #endif | 65 #endif |
| 65 | 66 |
| 66 typedef HashMap<RefPtr<SecurityOrigin>, OriginUsageRecord*, SecurityOriginHa
sh> OriginUsageMap; | 67 typedef HashMap<RefPtr<SecurityOrigin>, OriginUsageRecord*, SecurityOriginHa
sh> OriginUsageMap; |
| 67 OriginUsageMap m_usageMap; | 68 OriginUsageMap m_usageMap; |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace WebCore | 71 } // namespace WebCore |
| 71 | 72 |
| 72 #endif // ENABLE(DATABASE) | 73 #endif // ENABLE(DATABASE) |
| 73 | 74 |
| 74 #endif // OriginQuotaManager_h | 75 #endif // OriginQuotaManager_h |
| OLD | NEW |