OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2011 Google, Inc. All Rights Reserved. | 3 * Copyright (C) 2011 Google, Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 DatabaseContext* DatabaseContext::Backend() { | 133 DatabaseContext* DatabaseContext::Backend() { |
134 return this; | 134 return this; |
135 } | 135 } |
136 | 136 |
137 DatabaseThread* DatabaseContext::GetDatabaseThread() { | 137 DatabaseThread* DatabaseContext::GetDatabaseThread() { |
138 if (!database_thread_ && !has_open_databases_) { | 138 if (!database_thread_ && !has_open_databases_) { |
139 // It's OK to ask for the m_databaseThread after we've requested | 139 // It's OK to ask for the m_databaseThread after we've requested |
140 // termination because we're still using it to execute the closing | 140 // termination because we're still using it to execute the closing |
141 // of the database. However, it is NOT OK to create a new thread | 141 // of the database. However, it is NOT OK to create a new thread |
142 // after we've requested termination. | 142 // after we've requested termination. |
143 ASSERT(!has_requested_termination_); | 143 DCHECK(!has_requested_termination_); |
144 | 144 |
145 // Create the database thread on first request - but not if at least one | 145 // Create the database thread on first request - but not if at least one |
146 // database was already opened, because in that case we already had a | 146 // database was already opened, because in that case we already had a |
147 // database thread and terminated it and should not create another. | 147 // database thread and terminated it and should not create another. |
148 database_thread_ = DatabaseThread::Create(); | 148 database_thread_ = DatabaseThread::Create(); |
149 database_thread_->Start(); | 149 database_thread_->Start(); |
150 } | 150 } |
151 | 151 |
152 return database_thread_.Get(); | 152 return database_thread_.Get(); |
153 } | 153 } |
(...skipping 26 matching lines...) Expand all Loading... |
180 | 180 |
181 SecurityOrigin* DatabaseContext::GetSecurityOrigin() const { | 181 SecurityOrigin* DatabaseContext::GetSecurityOrigin() const { |
182 return GetExecutionContext()->GetSecurityOrigin(); | 182 return GetExecutionContext()->GetSecurityOrigin(); |
183 } | 183 } |
184 | 184 |
185 bool DatabaseContext::IsContextThread() const { | 185 bool DatabaseContext::IsContextThread() const { |
186 return GetExecutionContext()->IsContextThread(); | 186 return GetExecutionContext()->IsContextThread(); |
187 } | 187 } |
188 | 188 |
189 } // namespace blink | 189 } // namespace blink |
OLD | NEW |