OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2013 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // notificationMutex() is currently independent of the other locks. | 56 // notificationMutex() is currently independent of the other locks. |
57 | 57 |
58 bool canEstablishDatabase(DatabaseContext*, const String& name, const String
& displayName, unsigned long estimatedSize, DatabaseError&); | 58 bool canEstablishDatabase(DatabaseContext*, const String& name, const String
& displayName, unsigned long estimatedSize, DatabaseError&); |
59 String fullPathForDatabase(SecurityOrigin*, const String& name, bool createI
fDoesNotExist = true); | 59 String fullPathForDatabase(SecurityOrigin*, const String& name, bool createI
fDoesNotExist = true); |
60 | 60 |
61 void addOpenDatabase(Database*); | 61 void addOpenDatabase(Database*); |
62 void removeOpenDatabase(Database*); | 62 void removeOpenDatabase(Database*); |
63 | 63 |
64 unsigned long long getMaxSizeForDatabase(const Database*); | 64 unsigned long long getMaxSizeForDatabase(const Database*); |
65 | 65 |
66 void closeDatabasesImmediately(const String& originIdentifier, const String&
name); | 66 void closeDatabasesImmediately(SecurityOrigin*, const String& name); |
67 | 67 |
68 void prepareToOpenDatabase(Database*); | 68 void prepareToOpenDatabase(Database*); |
69 void failedToOpenDatabase(Database*); | 69 void failedToOpenDatabase(Database*); |
70 | 70 |
71 private: | 71 private: |
72 using DatabaseSet = HashSet<UntracedMember<Database>>; | 72 using DatabaseSet = HashSet<UntracedMember<Database>>; |
73 using DatabaseNameMap = HashMap<String, DatabaseSet*>; | 73 using DatabaseNameMap = HashMap<String, DatabaseSet*>; |
74 using DatabaseOriginMap = HashMap<String, DatabaseNameMap*>; | 74 using DatabaseOriginMap = HashMap<String, DatabaseNameMap*>; |
75 class CloseOneDatabaseImmediatelyTask; | 75 class CloseOneDatabaseImmediatelyTask; |
76 | 76 |
77 DatabaseTracker(); | 77 DatabaseTracker(); |
78 | 78 |
79 void closeOneDatabaseImmediately(const String& originIdentifier, const Strin
g& name, Database*); | 79 void closeOneDatabaseImmediately(const String& originIdentifier, const Strin
g& name, Database*); |
80 | 80 |
81 Mutex m_openDatabaseMapGuard; | 81 Mutex m_openDatabaseMapGuard; |
82 | 82 |
83 // This map contains untraced pointers to a garbage-collected class. We can'
t | 83 // This map contains untraced pointers to a garbage-collected class. We can'
t |
84 // make this traceable because it is updated by multiple database threads. | 84 // make this traceable because it is updated by multiple database threads. |
85 // See http://crbug.com/417990 | 85 // See http://crbug.com/417990 |
86 mutable OwnPtr<DatabaseOriginMap> m_openDatabaseMap; | 86 mutable OwnPtr<DatabaseOriginMap> m_openDatabaseMap; |
87 }; | 87 }; |
88 | 88 |
89 } // namespace blink | 89 } // namespace blink |
90 | 90 |
91 #endif // DatabaseTracker_h | 91 #endif // DatabaseTracker_h |
OLD | NEW |