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

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

Issue 201623003: Rollback transactions by observing them weakly from DatabaseSync. (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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 class DatabaseSync; 44 class DatabaseSync;
45 class SQLResultSet; 45 class SQLResultSet;
46 class SQLTransactionClient; 46 class SQLTransactionClient;
47 class SQLTransactionSyncCallback; 47 class SQLTransactionSyncCallback;
48 class SQLValue; 48 class SQLValue;
49 class SQLiteTransaction; 49 class SQLiteTransaction;
50 class ExceptionState; 50 class ExceptionState;
51 51
52 // Instances of this class should be created and used only on the worker's conte xt thread. 52 // Instances of this class should be created and used only on the worker's conte xt thread.
53 class SQLTransactionBackendSync : public RefCounted<SQLTransactionBackendSync> { 53 class SQLTransactionBackendSync : public RefCountedWillBeGarbageCollectedFinaliz ed<SQLTransactionBackendSync> {
54 public: 54 public:
55 ~SQLTransactionBackendSync(); 55 ~SQLTransactionBackendSync();
56 void trace(Visitor*);
56 57
57 PassRefPtr<SQLResultSet> executeSQL(const String& sqlStatement, const Vector <SQLValue>& arguments, ExceptionState&); 58 PassRefPtr<SQLResultSet> executeSQL(const String& sqlStatement, const Vector <SQLValue>& arguments, ExceptionState&);
58 59
59 DatabaseSync* database() { return m_database.get(); } 60 DatabaseSync* database() { return m_database.get(); }
60 61
61 void begin(ExceptionState&); 62 void begin(ExceptionState&);
62 void execute(ExceptionState&); 63 void execute(ExceptionState&);
63 void commit(ExceptionState&); 64 void commit(ExceptionState&);
64 void rollback(); 65 void rollback();
66 void rollbackIfInProgress();
65 67
66 private: 68 private:
67 SQLTransactionBackendSync(DatabaseSync*, PassOwnPtr<SQLTransactionSyncCallba ck>, bool readOnly); 69 SQLTransactionBackendSync(DatabaseSync*, PassOwnPtr<SQLTransactionSyncCallba ck>, bool readOnly);
68 70
69 RefPtrWillBePersistent<DatabaseSync> m_database; 71 RefPtrWillBeMember<DatabaseSync> m_database;
70 OwnPtr<SQLTransactionSyncCallback> m_callback; 72 OwnPtr<SQLTransactionSyncCallback> m_callback;
71 bool m_readOnly; 73 bool m_readOnly;
72 bool m_hasVersionMismatch; 74 bool m_hasVersionMismatch;
73 75
74 bool m_modifiedDatabase; 76 bool m_modifiedDatabase;
75 OwnPtr<SQLTransactionClient> m_transactionClient; 77 OwnPtr<SQLTransactionClient> m_transactionClient;
76 OwnPtr<SQLiteTransaction> m_sqliteTransaction; 78 OwnPtr<SQLiteTransaction> m_sqliteTransaction;
77 79
78 friend class SQLTransactionSync; // FIXME: Remove this once the front-end ha s been properly isolated. 80 friend class SQLTransactionSync; // FIXME: Remove this once the front-end ha s been properly isolated.
79 }; 81 };
80 82
81 } // namespace WebCore 83 } // namespace WebCore
82 84
83 #endif // SQLTransactionBackendSync_h 85 #endif // SQLTransactionBackendSync_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698