| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 class DatabaseContext; | 46 class DatabaseContext; |
| 47 class Page; | 47 class Page; |
| 48 class SecurityOrigin; | 48 class SecurityOrigin; |
| 49 | 49 |
| 50 class MODULES_EXPORT DatabaseTracker { | 50 class MODULES_EXPORT DatabaseTracker { |
| 51 WTF_MAKE_NONCOPYABLE(DatabaseTracker); | 51 WTF_MAKE_NONCOPYABLE(DatabaseTracker); |
| 52 USING_FAST_MALLOC(DatabaseTracker); | 52 USING_FAST_MALLOC(DatabaseTracker); |
| 53 | 53 |
| 54 public: | 54 public: |
| 55 static DatabaseTracker& tracker(); | 55 static DatabaseTracker& tracker(); |
| 56 // This singleton will potentially be used from multiple worker threads and th
e page's context thread simultaneously. To keep this safe, it's | 56 // This singleton will potentially be used from multiple worker threads and |
| 57 // currently using 4 locks. In order to avoid deadlock when taking multiple l
ocks, you must take them in the correct order: | 57 // the page's context thread simultaneously. To keep this safe, it's |
| 58 // currently using 4 locks. In order to avoid deadlock when taking multiple |
| 59 // locks, you must take them in the correct order: |
| 58 // m_databaseGuard before quotaManager if both locks are needed. | 60 // m_databaseGuard before quotaManager if both locks are needed. |
| 59 // m_openDatabaseMapGuard before quotaManager if both locks are needed. | 61 // m_openDatabaseMapGuard before quotaManager if both locks are needed. |
| 60 // m_databaseGuard and m_openDatabaseMapGuard currently don't overlap. | 62 // m_databaseGuard and m_openDatabaseMapGuard currently don't overlap. |
| 61 // notificationMutex() is currently independent of the other locks. | 63 // notificationMutex() is currently independent of the other locks. |
| 62 | 64 |
| 63 bool canEstablishDatabase(DatabaseContext*, | 65 bool canEstablishDatabase(DatabaseContext*, |
| 64 const String& name, | 66 const String& name, |
| 65 const String& displayName, | 67 const String& displayName, |
| 66 unsigned estimatedSize, | 68 unsigned estimatedSize, |
| 67 DatabaseError&); | 69 DatabaseError&); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 94 Database*); | 96 Database*); |
| 95 | 97 |
| 96 Mutex m_openDatabaseMapGuard; | 98 Mutex m_openDatabaseMapGuard; |
| 97 | 99 |
| 98 mutable std::unique_ptr<DatabaseOriginMap> m_openDatabaseMap; | 100 mutable std::unique_ptr<DatabaseOriginMap> m_openDatabaseMap; |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 } // namespace blink | 103 } // namespace blink |
| 102 | 104 |
| 103 #endif // DatabaseTracker_h | 105 #endif // DatabaseTracker_h |
| OLD | NEW |