Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: Source/modules/webdatabase/DatabaseThread.cpp

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 MutexLocker lock(m_terminationRequestedMutex); 90 MutexLocker lock(m_terminationRequestedMutex);
91 ASSERT(!m_terminationRequested); 91 ASSERT(!m_terminationRequested);
92 m_terminationRequested = true; 92 m_terminationRequested = true;
93 m_cleanupSync = cleanupSync; 93 m_cleanupSync = cleanupSync;
94 WTF_LOG(StorageAPI, "DatabaseThread %p was asked to terminate\n", this); 94 WTF_LOG(StorageAPI, "DatabaseThread %p was asked to terminate\n", this);
95 m_thread->postTask(new Task(WTF::bind(&DatabaseThread::cleanupDatabaseThread , this))); 95 m_thread->postTask(new Task(WTF::bind(&DatabaseThread::cleanupDatabaseThread , this)));
96 } 96 }
97 97
98 bool DatabaseThread::terminationRequested(TaskSynchronizer* taskSynchronizer) co nst 98 bool DatabaseThread::terminationRequested(TaskSynchronizer* taskSynchronizer) co nst
99 { 99 {
100 #ifndef NDEBUG 100 #if ENABLE(ASSERT)
101 if (taskSynchronizer) 101 if (taskSynchronizer)
102 taskSynchronizer->setHasCheckedForTermination(); 102 taskSynchronizer->setHasCheckedForTermination();
103 #endif 103 #endif
104 104
105 MutexLocker lock(m_terminationRequestedMutex); 105 MutexLocker lock(m_terminationRequestedMutex);
106 return m_terminationRequested; 106 return m_terminationRequested;
107 } 107 }
108 108
109 void DatabaseThread::cleanupDatabaseThread() 109 void DatabaseThread::cleanupDatabaseThread()
110 { 110 {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task) 166 void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task)
167 { 167 {
168 ASSERT(m_thread); 168 ASSERT(m_thread);
169 ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination()); 169 ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination());
170 // WebThread takes ownership of the task. 170 // WebThread takes ownership of the task.
171 m_thread->postTask(task.leakPtr()); 171 m_thread->postTask(task.leakPtr());
172 } 172 }
173 173
174 } // namespace WebCore 174 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/DatabaseTask.h ('k') | Source/modules/webdatabase/SQLTransactionStateMachine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698