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

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

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
Patch Set: Rebase Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 #if ENABLE(ASSERT) 829 #if ENABLE(ASSERT)
830 SQLTransactionErrorCallback* originalErrorCallback = errorCallback; 830 SQLTransactionErrorCallback* originalErrorCallback = errorCallback;
831 #endif 831 #endif
832 SQLTransaction* transaction = SQLTransaction::create(this, callback, success Callback, errorCallback, readOnly); 832 SQLTransaction* transaction = SQLTransaction::create(this, callback, success Callback, errorCallback, readOnly);
833 SQLTransactionBackend* transactionBackend = runTransaction(transaction, read Only, changeVersionData); 833 SQLTransactionBackend* transactionBackend = runTransaction(transaction, read Only, changeVersionData);
834 if (!transactionBackend) { 834 if (!transactionBackend) {
835 SQLTransactionErrorCallback* callback = transaction->releaseErrorCallbac k(); 835 SQLTransactionErrorCallback* callback = transaction->releaseErrorCallbac k();
836 ASSERT(callback == originalErrorCallback); 836 ASSERT(callback == originalErrorCallback);
837 if (callback) { 837 if (callback) {
838 OwnPtr<SQLErrorData> error = SQLErrorData::create(SQLError::UNKNOWN_ ERR, "database has been closed"); 838 OwnPtr<SQLErrorData> error = SQLErrorData::create(SQLError::UNKNOWN_ ERR, "database has been closed");
839 getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTas k(&callTransactionErrorCallback, callback, passed(error.release()))); 839 getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTas k(&callTransactionErrorCallback, retainedRef(callback), passed(error.release())) );
840 } 840 }
841 } 841 }
842 } 842 }
843 843
844 void Database::scheduleTransactionCallback(SQLTransaction* transaction) 844 void Database::scheduleTransactionCallback(SQLTransaction* transaction)
845 { 845 {
846 // The task is constructed in a database thread, and destructed in the 846 // The task is constructed in a database thread, and destructed in the
847 // context thread. 847 // context thread.
848 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&SQLT ransaction::performPendingCallback, crossThreadRetainedRef(transaction))); 848 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&SQLT ransaction::performPendingCallback, crossThreadRetainedRef(transaction)));
849 } 849 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 return m_databaseThreadSecurityOrigin.get(); 902 return m_databaseThreadSecurityOrigin.get();
903 return 0; 903 return 0;
904 } 904 }
905 905
906 bool Database::opened() 906 bool Database::opened()
907 { 907 {
908 return static_cast<bool>(acquireLoad(&m_opened)); 908 return static_cast<bool>(acquireLoad(&m_opened));
909 } 909 }
910 910
911 } // namespace blink 911 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698