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

Side by Side Diff: Source/modules/webdatabase/SQLTransactionBackendSync.cpp

Issue 207453006: Oilpan: Prepare to move SQLResultSet and SQLResultSetRowList to oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 #else 76 #else
77 rollbackIfInProgress(); 77 rollbackIfInProgress();
78 #endif 78 #endif
79 } 79 }
80 80
81 void SQLTransactionBackendSync::trace(Visitor* visitor) 81 void SQLTransactionBackendSync::trace(Visitor* visitor)
82 { 82 {
83 visitor->trace(m_database); 83 visitor->trace(m_database);
84 } 84 }
85 85
86 PassRefPtr<SQLResultSet> SQLTransactionBackendSync::executeSQL(const String& sql Statement, const Vector<SQLValue>& arguments, ExceptionState& exceptionState) 86 PassRefPtrWillBeRawPtr<SQLResultSet> SQLTransactionBackendSync::executeSQL(const String& sqlStatement, const Vector<SQLValue>& arguments, ExceptionState& except ionState)
87 { 87 {
88 ASSERT(m_database->executionContext()->isContextThread()); 88 ASSERT(m_database->executionContext()->isContextThread());
89 89
90 m_database->setLastErrorMessage(""); 90 m_database->setLastErrorMessage("");
91 91
92 if (!m_database->opened()) { 92 if (!m_database->opened()) {
93 m_database->setLastErrorMessage("cannot executeSQL because the database is not open"); 93 m_database->setLastErrorMessage("cannot executeSQL because the database is not open");
94 exceptionState.throwDOMException(UnknownError, SQLError::unknownErrorMes sage); 94 exceptionState.throwDOMException(UnknownError, SQLError::unknownErrorMes sage);
95 return nullptr; 95 return nullptr;
96 } 96 }
(...skipping 10 matching lines...) Expand all
107 int permissions = DatabaseAuthorizer::ReadWriteMask; 107 int permissions = DatabaseAuthorizer::ReadWriteMask;
108 if (!m_database->databaseContext()->allowDatabaseAccess()) 108 if (!m_database->databaseContext()->allowDatabaseAccess())
109 permissions |= DatabaseAuthorizer::NoAccessMask; 109 permissions |= DatabaseAuthorizer::NoAccessMask;
110 else if (m_readOnly) 110 else if (m_readOnly)
111 permissions |= DatabaseAuthorizer::ReadOnlyMask; 111 permissions |= DatabaseAuthorizer::ReadOnlyMask;
112 112
113 SQLStatementSync statement(sqlStatement, arguments, permissions); 113 SQLStatementSync statement(sqlStatement, arguments, permissions);
114 114
115 m_database->resetAuthorizer(); 115 m_database->resetAuthorizer();
116 bool retryStatement = true; 116 bool retryStatement = true;
117 RefPtr<SQLResultSet> resultSet; 117 RefPtrWillBeRawPtr<SQLResultSet> resultSet;
118 while (retryStatement) { 118 while (retryStatement) {
119 retryStatement = false; 119 retryStatement = false;
120 resultSet = statement.execute(m_database.get(), exceptionState); 120 resultSet = statement.execute(m_database.get(), exceptionState);
121 if (!resultSet) { 121 if (!resultSet) {
122 if (m_sqliteTransaction->wasRolledBackBySqlite()) 122 if (m_sqliteTransaction->wasRolledBackBySqlite())
123 return nullptr; 123 return nullptr;
124 124
125 if (exceptionState.code() == QuotaExceededError) { 125 if (exceptionState.code() == QuotaExceededError) {
126 if (m_transactionClient->didExceedQuota(database())) { 126 if (m_transactionClient->didExceedQuota(database())) {
127 exceptionState.clearException(); 127 exceptionState.clearException();
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 if (m_sqliteTransaction) { 251 if (m_sqliteTransaction) {
252 m_sqliteTransaction->rollback(); 252 m_sqliteTransaction->rollback();
253 m_sqliteTransaction.clear(); 253 m_sqliteTransaction.clear();
254 } 254 }
255 m_database->enableAuthorizer(); 255 m_database->enableAuthorizer();
256 256
257 ASSERT(!m_database->sqliteDatabase().transactionInProgress()); 257 ASSERT(!m_database->sqliteDatabase().transactionInProgress());
258 } 258 }
259 259
260 } // namespace WebCore 260 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698