OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 | 386 |
387 releaseStore(&m_opened, 0); | 387 releaseStore(&m_opened, 0); |
388 m_sqliteDatabase.close(); | 388 m_sqliteDatabase.close(); |
389 // See comment at the top this file regarding calling removeOpenDatabase(). | 389 // See comment at the top this file regarding calling removeOpenDatabase(). |
390 DatabaseTracker::tracker().removeOpenDatabase(this); | 390 DatabaseTracker::tracker().removeOpenDatabase(this); |
391 { | 391 { |
392 SafePointAwareMutexLocker locker(guidMutex()); | 392 SafePointAwareMutexLocker locker(guidMutex()); |
393 | 393 |
394 ASSERT(guidCount().contains(m_guid)); | 394 ASSERT(guidCount().contains(m_guid)); |
395 if (guidCount().remove(m_guid)) { | 395 if (guidCount().remove(m_guid)) { |
396 guidToVersionMap().remove(m_guid); | 396 guidToVersionMap().erase(m_guid); |
397 } | 397 } |
398 } | 398 } |
399 } | 399 } |
400 | 400 |
401 String Database::version() const { | 401 String Database::version() const { |
402 // Note: In multi-process browsers the cached value may be accurate, but we | 402 // Note: In multi-process browsers the cached value may be accurate, but we |
403 // cannot read the actual version from the database without potentially | 403 // cannot read the actual version from the database without potentially |
404 // inducing a deadlock. | 404 // inducing a deadlock. |
405 // FIXME: Add an async version getter to the DatabaseAPI. | 405 // FIXME: Add an async version getter to the DatabaseAPI. |
406 return getCachedVersion(); | 406 return getCachedVersion(); |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 if (getDatabaseContext()->databaseThread()->isDatabaseThread()) | 946 if (getDatabaseContext()->databaseThread()->isDatabaseThread()) |
947 return m_databaseThreadSecurityOrigin.get(); | 947 return m_databaseThreadSecurityOrigin.get(); |
948 return nullptr; | 948 return nullptr; |
949 } | 949 } |
950 | 950 |
951 bool Database::opened() { | 951 bool Database::opened() { |
952 return static_cast<bool>(acquireLoad(&m_opened)); | 952 return static_cast<bool>(acquireLoad(&m_opened)); |
953 } | 953 } |
954 | 954 |
955 } // namespace blink | 955 } // namespace blink |
OLD | NEW |