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

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

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
Patch Set: Rebase Created 4 years, 7 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
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (m_openDatabaseSet.size() > 0) { 104 if (m_openDatabaseSet.size() > 0) {
105 // As the call to close will modify the original set, we must take a cop y to iterate over. 105 // As the call to close will modify the original set, we must take a cop y to iterate over.
106 HeapHashSet<Member<Database>> openSetCopy; 106 HeapHashSet<Member<Database>> openSetCopy;
107 openSetCopy.swap(m_openDatabaseSet); 107 openSetCopy.swap(m_openDatabaseSet);
108 HeapHashSet<Member<Database>>::iterator end = openSetCopy.end(); 108 HeapHashSet<Member<Database>>::iterator end = openSetCopy.end();
109 for (HeapHashSet<Member<Database>>::iterator it = openSetCopy.begin(); i t != end; ++it) 109 for (HeapHashSet<Member<Database>>::iterator it = openSetCopy.begin(); i t != end; ++it)
110 (*it)->close(); 110 (*it)->close();
111 } 111 }
112 m_openDatabaseSet.clear(); 112 m_openDatabaseSet.clear();
113 113
114 m_thread->postTask(BLINK_FROM_HERE, WTF::bind(&DatabaseThread::cleanupDataba seThreadCompleted, this)); 114 m_thread->postTask(BLINK_FROM_HERE, WTF::bind(&DatabaseThread::cleanupDataba seThreadCompleted, retainedRef(this)));
115 } 115 }
116 116
117 void DatabaseThread::cleanupDatabaseThreadCompleted() 117 void DatabaseThread::cleanupDatabaseThreadCompleted()
118 { 118 {
119 m_thread->shutdown(); 119 m_thread->shutdown();
120 if (m_cleanupSync) // Someone wanted to know when we were done cleaning up. 120 if (m_cleanupSync) // Someone wanted to know when we were done cleaning up.
121 m_cleanupSync->taskCompleted(); 121 m_cleanupSync->taskCompleted();
122 } 122 }
123 123
124 void DatabaseThread::recordDatabaseOpen(Database* database) 124 void DatabaseThread::recordDatabaseOpen(Database* database)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 { 166 {
167 MutexLocker lock(m_terminationRequestedMutex); 167 MutexLocker lock(m_terminationRequestedMutex);
168 ASSERT(!m_terminationRequested); 168 ASSERT(!m_terminationRequested);
169 } 169 }
170 #endif 170 #endif
171 // WebThread takes ownership of the task. 171 // WebThread takes ownership of the task.
172 m_thread->postTask(BLINK_FROM_HERE, threadSafeBind(&DatabaseTask::run, std:: move(task))); 172 m_thread->postTask(BLINK_FROM_HERE, threadSafeBind(&DatabaseTask::run, std:: move(task)));
173 } 173 }
174 174
175 } // namespace blink 175 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698