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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 WTF_LOG_ERROR("Failed to step statement to set value in database (%s)",
query.ascii().data()); | 132 WTF_LOG_ERROR("Failed to step statement to set value in database (%s)",
query.ascii().data()); |
133 return false; | 133 return false; |
134 } | 134 } |
135 | 135 |
136 return true; | 136 return true; |
137 } | 137 } |
138 | 138 |
139 // FIXME: move all guid-related functions to a DatabaseVersionTracker class. | 139 // FIXME: move all guid-related functions to a DatabaseVersionTracker class. |
140 static RecursiveMutex& guidMutex() | 140 static RecursiveMutex& guidMutex() |
141 { | 141 { |
142 AtomicallyInitializedStatic(RecursiveMutex&, mutex = *new RecursiveMutex); | 142 AtomicallyInitializedStaticReference(RecursiveMutex, mutex, new RecursiveMut
ex); |
143 return mutex; | 143 return mutex; |
144 } | 144 } |
145 | 145 |
146 typedef HashMap<DatabaseGuid, String> GuidVersionMap; | 146 typedef HashMap<DatabaseGuid, String> GuidVersionMap; |
147 static GuidVersionMap& guidToVersionMap() | 147 static GuidVersionMap& guidToVersionMap() |
148 { | 148 { |
149 // Ensure the the mutex is locked. | 149 // Ensure the the mutex is locked. |
150 ASSERT(guidMutex().locked()); | 150 ASSERT(guidMutex().locked()); |
151 DEFINE_STATIC_LOCAL(GuidVersionMap, map, ()); | 151 DEFINE_STATIC_LOCAL(GuidVersionMap, map, ()); |
152 return map; | 152 return map; |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 SecurityOrigin* Database::securityOrigin() const | 920 SecurityOrigin* Database::securityOrigin() const |
921 { | 921 { |
922 if (executionContext()->isContextThread()) | 922 if (executionContext()->isContextThread()) |
923 return m_contextThreadSecurityOrigin.get(); | 923 return m_contextThreadSecurityOrigin.get(); |
924 if (databaseContext()->databaseThread()->isDatabaseThread()) | 924 if (databaseContext()->databaseThread()->isDatabaseThread()) |
925 return m_databaseThreadSecurityOrigin.get(); | 925 return m_databaseThreadSecurityOrigin.get(); |
926 return 0; | 926 return 0; |
927 } | 927 } |
928 | 928 |
929 } // namespace blink | 929 } // namespace blink |
OLD | NEW |