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

Side by Side Diff: Source/WebCore/storage/chromium/QuotaTracker.cpp

Issue 8152004: Merge 96554 - A little more WebSQLDatabase thread safety. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 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 | « Source/WebCore/storage/chromium/DatabaseTrackerChromium.cpp ('k') | no next file » | 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) 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
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
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)
OLDNEW
« no previous file with comments | « Source/WebCore/storage/chromium/DatabaseTrackerChromium.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698