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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #if ENABLE(OILPAN) | 65 #if ENABLE(OILPAN) |
66 visitor->trace(m_openDatabaseSet); | 66 visitor->trace(m_openDatabaseSet); |
67 visitor->trace(m_transactionCoordinator); | 67 visitor->trace(m_transactionCoordinator); |
68 #endif | 68 #endif |
69 } | 69 } |
70 | 70 |
71 void DatabaseThread::start() | 71 void DatabaseThread::start() |
72 { | 72 { |
73 if (m_thread) | 73 if (m_thread) |
74 return; | 74 return; |
75 m_thread = adoptPtr(blink::Platform::current()->createThread("WebCore: Datab
ase")); | 75 m_thread = adoptPtr(Platform::current()->createThread("WebCore: Database")); |
76 m_thread->postTask(new Task(WTF::bind(&DatabaseThread::setupDatabaseThread,
this))); | 76 m_thread->postTask(new Task(WTF::bind(&DatabaseThread::setupDatabaseThread,
this))); |
77 } | 77 } |
78 | 78 |
79 void DatabaseThread::setupDatabaseThread() | 79 void DatabaseThread::setupDatabaseThread() |
80 { | 80 { |
81 m_pendingGCRunner = adoptPtr(new PendingGCRunner); | 81 m_pendingGCRunner = adoptPtr(new PendingGCRunner); |
82 m_messageLoopInterruptor = adoptPtr(new MessageLoopInterruptor(m_thread.get(
))); | 82 m_messageLoopInterruptor = adoptPtr(new MessageLoopInterruptor(m_thread.get(
))); |
83 m_thread->addTaskObserver(m_pendingGCRunner.get()); | 83 m_thread->addTaskObserver(m_pendingGCRunner.get()); |
84 ThreadState::attach(); | 84 ThreadState::attach(); |
85 ThreadState::current()->addInterruptor(m_messageLoopInterruptor.get()); | 85 ThreadState::current()->addInterruptor(m_messageLoopInterruptor.get()); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 blink | 174 } // namespace blink |
OLD | NEW |