| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 , m_executionContext(m_callback ? executionContext : 0) | 49 , m_executionContext(m_callback ? executionContext : 0) |
| 50 { | 50 { |
| 51 ASSERT(!m_callback || (m_executionContext.get() && m_executionContext->i
sContextThread())); | 51 ASSERT(!m_callback || (m_executionContext.get() && m_executionContext->i
sContextThread())); |
| 52 } | 52 } |
| 53 | 53 |
| 54 ~SQLCallbackWrapper() | 54 ~SQLCallbackWrapper() |
| 55 { | 55 { |
| 56 clear(); | 56 clear(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void trace(Visitor* visitor) { visitor->trace(m_executionContext); } | 59 // FIXME: Oilpan: Trace m_executionContext. |
| 60 void trace(Visitor* visitor) { } |
| 60 | 61 |
| 61 void clear() | 62 void clear() |
| 62 { | 63 { |
| 63 #if ENABLE(OILPAN) | 64 #if ENABLE(OILPAN) |
| 64 // It's safe to call ~T in non-context-thread. | 65 // It's safe to call ~T in non-context-thread. |
| 65 // Implementation classes of ExecutionContext are on-heap. Their | 66 // Implementation classes of ExecutionContext are on-heap. Their |
| 66 // destructors are called in their owner threads. | 67 // destructors are called in their owner threads. |
| 67 MutexLocker locker(m_mutex); | 68 MutexLocker locker(m_mutex); |
| 68 m_callback.clear(); | 69 m_callback.clear(); |
| 69 m_executionContext.clear(); | 70 m_executionContext.clear(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 : m_callbackToRelease(callbackToRelease) | 123 : m_callbackToRelease(callbackToRelease) |
| 123 { | 124 { |
| 124 } | 125 } |
| 125 | 126 |
| 126 OwnPtr<T> m_callbackToRelease; | 127 OwnPtr<T> m_callbackToRelease; |
| 127 }; | 128 }; |
| 128 #endif | 129 #endif |
| 129 | 130 |
| 130 Mutex m_mutex; | 131 Mutex m_mutex; |
| 131 OwnPtr<T> m_callback; | 132 OwnPtr<T> m_callback; |
| 132 RefPtrWillBeMember<ExecutionContext> m_executionContext; | 133 RefPtr<ExecutionContext> m_executionContext; |
| 133 }; | 134 }; |
| 134 | 135 |
| 135 } // namespace WebCore | 136 } // namespace WebCore |
| 136 | 137 |
| 137 #endif // SQLCallbackWrapper_h | 138 #endif // SQLCallbackWrapper_h |
| OLD | NEW |