OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 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 * | 7 * |
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 DatabaseTask::~DatabaseTask() { | 48 DatabaseTask::~DatabaseTask() { |
49 #if DCHECK_IS_ON() | 49 #if DCHECK_IS_ON() |
50 DCHECK(complete_ || !complete_event_); | 50 DCHECK(complete_ || !complete_event_); |
51 #endif | 51 #endif |
52 } | 52 } |
53 | 53 |
54 void DatabaseTask::Run() { | 54 void DatabaseTask::Run() { |
55 // Database tasks are meant to be used only once, so make sure this one hasn't | 55 // Database tasks are meant to be used only once, so make sure this one hasn't |
56 // been performed before. | 56 // been performed before. |
57 #if DCHECK_IS_ON() | 57 #if DCHECK_IS_ON() |
58 ASSERT(!complete_); | 58 DCHECK(!complete_); |
59 #endif | 59 #endif |
60 | 60 |
61 if (!complete_event_ && | 61 if (!complete_event_ && |
62 !database_->GetDatabaseContext()->GetDatabaseThread()->IsDatabaseOpen( | 62 !database_->GetDatabaseContext()->GetDatabaseThread()->IsDatabaseOpen( |
63 database_.Get())) { | 63 database_.Get())) { |
64 TaskCancelled(); | 64 TaskCancelled(); |
65 #if DCHECK_IS_ON() | 65 #if DCHECK_IS_ON() |
66 complete_ = true; | 66 complete_ = true; |
67 #endif | 67 #endif |
68 return; | 68 return; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 table_names_ = GetDatabase()->PerformGetTableNames(); | 178 table_names_ = GetDatabase()->PerformGetTableNames(); |
179 } | 179 } |
180 | 180 |
181 #if DCHECK_IS_ON() | 181 #if DCHECK_IS_ON() |
182 const char* Database::DatabaseTableNamesTask::DebugTaskName() const { | 182 const char* Database::DatabaseTableNamesTask::DebugTaskName() const { |
183 return "DatabaseTableNamesTask"; | 183 return "DatabaseTableNamesTask"; |
184 } | 184 } |
185 #endif | 185 #endif |
186 | 186 |
187 } // namespace blink | 187 } // namespace blink |
OLD | NEW |