| 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 // FIXME: Oilpan: Trace m_executionContext. | 59 void trace(Visitor* visitor) { visitor->trace(m_executionContext); } |
| 60 void trace(Visitor* visitor) { } | |
| 61 | 60 |
| 62 void clear() | 61 void clear() |
| 63 { | 62 { |
| 64 #if ENABLE(OILPAN) | 63 #if ENABLE(OILPAN) |
| 65 // It's safe to call ~T in non-context-thread. | 64 // It's safe to call ~T in non-context-thread. |
| 66 // Implementation classes of ExecutionContext are on-heap. Their | 65 // Implementation classes of ExecutionContext are on-heap. Their |
| 67 // destructors are called in their owner threads. | 66 // destructors are called in their owner threads. |
| 68 MutexLocker locker(m_mutex); | 67 MutexLocker locker(m_mutex); |
| 69 m_callback.clear(); | 68 m_callback.clear(); |
| 70 m_executionContext.clear(); | 69 m_executionContext.clear(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 : m_callbackToRelease(callbackToRelease) | 122 : m_callbackToRelease(callbackToRelease) |
| 124 { | 123 { |
| 125 } | 124 } |
| 126 | 125 |
| 127 OwnPtr<T> m_callbackToRelease; | 126 OwnPtr<T> m_callbackToRelease; |
| 128 }; | 127 }; |
| 129 #endif | 128 #endif |
| 130 | 129 |
| 131 Mutex m_mutex; | 130 Mutex m_mutex; |
| 132 OwnPtr<T> m_callback; | 131 OwnPtr<T> m_callback; |
| 133 RefPtr<ExecutionContext> m_executionContext; | 132 RefPtrWillBeMember<ExecutionContext> m_executionContext; |
| 134 }; | 133 }; |
| 135 | 134 |
| 136 } // namespace WebCore | 135 } // namespace WebCore |
| 137 | 136 |
| 138 #endif // SQLCallbackWrapper_h | 137 #endif // SQLCallbackWrapper_h |
| OLD | NEW |