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

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

Issue 327323002: Start removing the double-negative !ASSERT_DISABLED (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « Source/core/xml/XPathStep.cpp ('k') | Source/modules/webdatabase/DatabaseManager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 RefPtrWillBeRawPtr<SQLError> error = SQLError::create(*errorData); 135 RefPtrWillBeRawPtr<SQLError> error = SQLError::create(*errorData);
136 callback->handleEvent(error.get()); 136 callback->handleEvent(error.get());
137 } 137 }
138 138
139 void Database::runTransaction(PassOwnPtr<SQLTransactionCallback> callback, PassO wnPtr<SQLTransactionErrorCallback> errorCallback, 139 void Database::runTransaction(PassOwnPtr<SQLTransactionCallback> callback, PassO wnPtr<SQLTransactionErrorCallback> errorCallback,
140 PassOwnPtr<VoidCallback> successCallback, bool readOnly, const ChangeVersion Data* changeVersionData) 140 PassOwnPtr<VoidCallback> successCallback, bool readOnly, const ChangeVersion Data* changeVersionData)
141 { 141 {
142 // FIXME: Rather than passing errorCallback to SQLTransaction and then somet imes firing it ourselves, 142 // FIXME: Rather than passing errorCallback to SQLTransaction and then somet imes firing it ourselves,
143 // this code should probably be pushed down into DatabaseBackend so that we only create the SQLTransaction 143 // this code should probably be pushed down into DatabaseBackend so that we only create the SQLTransaction
144 // if we're actually going to run it. 144 // if we're actually going to run it.
145 #if !ASSERT_DISABLED 145 #if ASSERT_ENABLED
146 SQLTransactionErrorCallback* originalErrorCallback = errorCallback.get(); 146 SQLTransactionErrorCallback* originalErrorCallback = errorCallback.get();
147 #endif 147 #endif
148 RefPtrWillBeRawPtr<SQLTransaction> transaction = SQLTransaction::create(this , callback, successCallback, errorCallback, readOnly); 148 RefPtrWillBeRawPtr<SQLTransaction> transaction = SQLTransaction::create(this , callback, successCallback, errorCallback, readOnly);
149 RefPtrWillBeRawPtr<SQLTransactionBackend> transactionBackend = backend()->ru nTransaction(transaction, readOnly, changeVersionData); 149 RefPtrWillBeRawPtr<SQLTransactionBackend> transactionBackend = backend()->ru nTransaction(transaction, readOnly, changeVersionData);
150 if (!transactionBackend) { 150 if (!transactionBackend) {
151 OwnPtr<SQLTransactionErrorCallback> callback = transaction->releaseError Callback(); 151 OwnPtr<SQLTransactionErrorCallback> callback = transaction->releaseError Callback();
152 ASSERT(callback == originalErrorCallback); 152 ASSERT(callback == originalErrorCallback);
153 if (callback) { 153 if (callback) {
154 OwnPtr<SQLErrorData> error = SQLErrorData::create(SQLError::UNKNOWN_ ERR, "database has been closed"); 154 OwnPtr<SQLErrorData> error = SQLErrorData::create(SQLError::UNKNOWN_ ERR, "database has been closed");
155 executionContext()->postTask(createCallbackTask(&callTransactionErro rCallback, callback.release(), error.release())); 155 executionContext()->postTask(createCallbackTask(&callTransactionErro rCallback, callback.release(), error.release()));
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 backend()->reportStartTransactionResult(errorSite, webSqlErrorCode, sqliteEr rorCode); 244 backend()->reportStartTransactionResult(errorSite, webSqlErrorCode, sqliteEr rorCode);
245 } 245 }
246 246
247 void Database::reportCommitTransactionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode) 247 void Database::reportCommitTransactionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode)
248 { 248 {
249 backend()->reportCommitTransactionResult(errorSite, webSqlErrorCode, sqliteE rrorCode); 249 backend()->reportCommitTransactionResult(errorSite, webSqlErrorCode, sqliteE rrorCode);
250 } 250 }
251 251
252 252
253 } // namespace WebCore 253 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/xml/XPathStep.cpp ('k') | Source/modules/webdatabase/DatabaseManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698