OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "storage/common/database/database_connections.h" | 5 #include "storage/common/database/database_connections.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 if (!main_thread_->BelongsToCurrentThread()) { | 162 if (!main_thread_->BelongsToCurrentThread()) { |
163 main_thread_->PostTask( | 163 main_thread_->PostTask( |
164 FROM_HERE, | 164 FROM_HERE, |
165 base::Bind(&DatabaseConnectionsWrapper::RemoveOpenConnection, this, | 165 base::Bind(&DatabaseConnectionsWrapper::RemoveOpenConnection, this, |
166 origin_identifier, database_name)); | 166 origin_identifier, database_name)); |
167 return; | 167 return; |
168 } | 168 } |
169 base::AutoLock auto_lock(open_connections_lock_); | 169 base::AutoLock auto_lock(open_connections_lock_); |
170 open_connections_.RemoveConnection(origin_identifier, database_name); | 170 open_connections_.RemoveConnection(origin_identifier, database_name); |
171 if (waiting_for_dbs_to_close_ && open_connections_.IsEmpty()) | 171 if (waiting_for_dbs_to_close_ && open_connections_.IsEmpty()) |
172 base::MessageLoop::current()->Quit(); | 172 base::MessageLoop::current()->QuitWhenIdle(); |
173 } | 173 } |
174 | 174 |
175 } // namespace storage | 175 } // namespace storage |
OLD | NEW |