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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 m_context.clear(); | 95 m_context.clear(); |
96 } | 96 } |
97 | 97 |
98 virtual bool isCleanupTask() const { return true; } | 98 virtual bool isCleanupTask() const { return true; } |
99 | 99 |
100 private: | 100 private: |
101 DerefContextTask(PassRefPtr<ScriptExecutionContext> context) | 101 DerefContextTask(PassRefPtr<ScriptExecutionContext> context) |
102 : m_context(context) | 102 : m_context(context) |
103 { | 103 { |
104 } | 104 } |
105 | 105 |
106 RefPtr<ScriptExecutionContext> m_context; | 106 RefPtr<ScriptExecutionContext> m_context; |
107 }; | 107 }; |
108 | 108 |
109 Database::~Database() | 109 Database::~Database() |
110 { | 110 { |
111 // The reference to the ScriptExecutionContext needs to be cleared on the Ja
vaScript thread. If we're on that thread already, we can just let the RefPtr's
destruction do the dereffing. | 111 // The reference to the ScriptExecutionContext needs to be cleared on the Ja
vaScript thread. If we're on that thread already, we can just let the RefPtr's
destruction do the dereffing. |
112 if (!m_scriptExecutionContext->isContextThread()) { | 112 if (!m_scriptExecutionContext->isContextThread()) { |
113 // Grab a pointer to the script execution here because we're releasing i
t when we pass it to | 113 // Grab a pointer to the script execution here because we're releasing i
t when we pass it to |
114 // DerefContextTask::create. | 114 // DerefContextTask::create. |
115 ScriptExecutionContext* scriptExecutionContext = m_scriptExecutionContex
t.get(); | 115 ScriptExecutionContext* scriptExecutionContext = m_scriptExecutionContex
t.get(); |
116 | 116 |
117 scriptExecutionContext->postTask(DerefContextTask::create(m_scriptExecut
ionContext.release())); | 117 scriptExecutionContext->postTask(DerefContextTask::create(m_scriptExecut
ionContext.release())); |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
121 Database* Database::from(DatabaseBackend* backend) | 121 Database* Database::from(DatabaseBackend* backend) |
122 { | 122 { |
123 return static_cast<Database*>(backend->m_frontend); | 123 return static_cast<Database*>(backend->m_frontend); |
124 } | 124 } |
125 | 125 |
126 PassRefPtr<DatabaseBackend> Database::backend() | 126 PassRefPtr<DatabaseBackend> Database::backend() |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 backend()->reportStartTransactionResult(errorSite, webSqlErrorCode, sqliteEr
rorCode); | 286 backend()->reportStartTransactionResult(errorSite, webSqlErrorCode, sqliteEr
rorCode); |
287 } | 287 } |
288 | 288 |
289 void Database::reportCommitTransactionResult(int errorSite, int webSqlErrorCode,
int sqliteErrorCode) | 289 void Database::reportCommitTransactionResult(int errorSite, int webSqlErrorCode,
int sqliteErrorCode) |
290 { | 290 { |
291 backend()->reportCommitTransactionResult(errorSite, webSqlErrorCode, sqliteE
rrorCode); | 291 backend()->reportCommitTransactionResult(errorSite, webSqlErrorCode, sqliteE
rrorCode); |
292 } | 292 } |
293 | 293 |
294 | 294 |
295 } // namespace WebCore | 295 } // namespace WebCore |
OLD | NEW |