| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) | 3 * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) |
| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 if (!SQLiteStatement(*this, "PRAGMA foreign_keys = OFF;").ExecuteCommand()) | 94 if (!SQLiteStatement(*this, "PRAGMA foreign_keys = OFF;").ExecuteCommand()) |
| 95 DLOG(ERROR) << "SQLite database could not turn off foreign_keys"; | 95 DLOG(ERROR) << "SQLite database could not turn off foreign_keys"; |
| 96 | 96 |
| 97 return IsOpen(); | 97 return IsOpen(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void SQLiteDatabase::Close() { | 100 void SQLiteDatabase::Close() { |
| 101 if (db_) { | 101 if (db_) { |
| 102 // FIXME: This is being called on the main thread during JS GC. | 102 // FIXME: This is being called on the main thread during JS GC. |
| 103 // <rdar://problem/5739818> | 103 // <rdar://problem/5739818> |
| 104 // ASSERT(currentThread() == m_openingThread); | 104 // DCHECK_EQ(currentThread(), m_openingThread); |
| 105 sqlite3* db = db_; | 105 sqlite3* db = db_; |
| 106 { | 106 { |
| 107 MutexLocker locker(database_closing_mutex_); | 107 MutexLocker locker(database_closing_mutex_); |
| 108 db_ = 0; | 108 db_ = 0; |
| 109 } | 109 } |
| 110 sqlite3_close(db); | 110 sqlite3_close(db); |
| 111 } | 111 } |
| 112 | 112 |
| 113 opening_thread_ = 0; | 113 opening_thread_ = 0; |
| 114 open_error_ = SQLITE_ERROR; | 114 open_error_ = SQLITE_ERROR; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 default: | 386 default: |
| 387 if (!ExecuteCommand("PRAGMA auto_vacuum = 2")) | 387 if (!ExecuteCommand("PRAGMA auto_vacuum = 2")) |
| 388 return false; | 388 return false; |
| 389 RunVacuumCommand(); | 389 RunVacuumCommand(); |
| 390 error = LastError(); | 390 error = LastError(); |
| 391 return (error == SQLITE_OK); | 391 return (error == SQLITE_OK); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 | 394 |
| 395 } // namespace blink | 395 } // namespace blink |
| OLD | NEW |