| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| 11 * copyright notice, this list of conditions and the following disclaimer | 11 * copyright notice, this list of conditions and the following disclaimer |
| 12 * in the documentation and/or other materials provided with the | 12 * in the documentation and/or other materials provided with the |
| (...skipping 20 matching lines...) Expand all Loading... |
| 33 #include "PlatformSupport.h" | 33 #include "PlatformSupport.h" |
| 34 | 34 |
| 35 #if ENABLE(DATABASE) | 35 #if ENABLE(DATABASE) |
| 36 | 36 |
| 37 #include <wtf/StdLibExtras.h> | 37 #include <wtf/StdLibExtras.h> |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 QuotaTracker& QuotaTracker::instance() | 41 QuotaTracker& QuotaTracker::instance() |
| 42 { | 42 { |
| 43 DEFINE_STATIC_LOCAL(QuotaTracker, tracker, ()); | 43 AtomicallyInitializedStatic(QuotaTracker&, tracker = *new QuotaTracker); |
| 44 return tracker; | 44 return tracker; |
| 45 } | 45 } |
| 46 | 46 |
| 47 void QuotaTracker::getDatabaseSizeAndSpaceAvailableToOrigin( | 47 void QuotaTracker::getDatabaseSizeAndSpaceAvailableToOrigin( |
| 48 const String& originIdentifier, const String& databaseName, | 48 const String& originIdentifier, const String& databaseName, |
| 49 unsigned long long* databaseSize, unsigned long long* spaceAvailable) | 49 unsigned long long* databaseSize, unsigned long long* spaceAvailable) |
| 50 { | 50 { |
| 51 // Extra scope to unlock prior to potentially calling PlatformSupport. | 51 // Extra scope to unlock prior to potentially calling PlatformSupport. |
| 52 { | 52 { |
| 53 MutexLocker lockData(m_dataGuard); | 53 MutexLocker lockData(m_dataGuard); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 83 | 83 |
| 84 void QuotaTracker::resetSpaceAvailableToOrigin(const String& originIdentifier) | 84 void QuotaTracker::resetSpaceAvailableToOrigin(const String& originIdentifier) |
| 85 { | 85 { |
| 86 MutexLocker lockData(m_dataGuard); | 86 MutexLocker lockData(m_dataGuard); |
| 87 m_spaceAvailableToOrigins.remove(originIdentifier); | 87 m_spaceAvailableToOrigins.remove(originIdentifier); |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace WebCore | 90 } // namespace WebCore |
| 91 | 91 |
| 92 #endif // ENABLE(DATABASE) | 92 #endif // ENABLE(DATABASE) |
| OLD | NEW |