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

Side by Side Diff: WebCore/storage/OriginQuotaManager.h

Issue 596028: Make the DatabaseTracker thread-safe. (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/
Patch Set: '' Created 10 years, 10 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
« no previous file with comments | « WebCore/storage/DatabaseTracker.cpp ('k') | WebCore/storage/OriginQuotaManager.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « WebCore/storage/DatabaseTracker.cpp ('k') | WebCore/storage/OriginQuotaManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698