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

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

Issue 1227783004: Fix virtual/override/final usage in Source/modules/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 5 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) 2007, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 virtual bool performPreflight(SQLTransactionBackend*) = 0; 53 virtual bool performPreflight(SQLTransactionBackend*) = 0;
54 virtual bool performPostflight(SQLTransactionBackend*) = 0; 54 virtual bool performPostflight(SQLTransactionBackend*) = 0;
55 virtual SQLErrorData* sqlError() const = 0; 55 virtual SQLErrorData* sqlError() const = 0;
56 virtual void handleCommitFailedAfterPostflight(SQLTransactionBackend*) = 0; 56 virtual void handleCommitFailedAfterPostflight(SQLTransactionBackend*) = 0;
57 }; 57 };
58 58
59 class SQLTransactionBackend final : public GarbageCollectedFinalized<SQLTransact ionBackend>, public SQLTransactionStateMachine<SQLTransactionBackend> { 59 class SQLTransactionBackend final : public GarbageCollectedFinalized<SQLTransact ionBackend>, public SQLTransactionStateMachine<SQLTransactionBackend> {
60 public: 60 public:
61 static SQLTransactionBackend* create(Database*, SQLTransaction*, SQLTransact ionWrapper*, bool readOnly); 61 static SQLTransactionBackend* create(Database*, SQLTransaction*, SQLTransact ionWrapper*, bool readOnly);
62 62
63 virtual ~SQLTransactionBackend(); 63 ~SQLTransactionBackend() override;
64 DECLARE_TRACE(); 64 DECLARE_TRACE();
65 65
66 void lockAcquired(); 66 void lockAcquired();
67 void performNextStep(); 67 void performNextStep();
68 68
69 Database* database() { return m_database.get(); } 69 Database* database() { return m_database.get(); }
70 bool isReadOnly() { return m_readOnly; } 70 bool isReadOnly() { return m_readOnly; }
71 void notifyDatabaseThreadIsShuttingDown(); 71 void notifyDatabaseThreadIsShuttingDown();
72 72
73 // APIs called from the frontend published: 73 // APIs called from the frontend published:
74 void requestTransitToState(SQLTransactionState); 74 void requestTransitToState(SQLTransactionState);
75 SQLErrorData* transactionError(); 75 SQLErrorData* transactionError();
76 SQLStatement* currentStatement(); 76 SQLStatement* currentStatement();
77 void setShouldRetryCurrentStatement(bool); 77 void setShouldRetryCurrentStatement(bool);
78 void executeSQL(SQLStatement*, const String& statement, const Vector<SQLValu e>& arguments, int permissions); 78 void executeSQL(SQLStatement*, const String& statement, const Vector<SQLValu e>& arguments, int permissions);
79 79
80 private: 80 private:
81 SQLTransactionBackend(Database*, SQLTransaction*, SQLTransactionWrapper*, bo ol readOnly); 81 SQLTransactionBackend(Database*, SQLTransaction*, SQLTransactionWrapper*, bo ol readOnly);
82 82
83 void doCleanup(); 83 void doCleanup();
84 84
85 void enqueueStatementBackend(SQLStatementBackend*); 85 void enqueueStatementBackend(SQLStatementBackend*);
86 86
87 // State Machine functions: 87 // State Machine functions:
88 virtual StateFunction stateFunctionFor(SQLTransactionState) override; 88 StateFunction stateFunctionFor(SQLTransactionState) override;
89 void computeNextStateAndCleanupIfNeeded(); 89 void computeNextStateAndCleanupIfNeeded();
90 90
91 // State functions: 91 // State functions:
92 SQLTransactionState acquireLock(); 92 SQLTransactionState acquireLock();
93 SQLTransactionState openTransactionAndPreflight(); 93 SQLTransactionState openTransactionAndPreflight();
94 SQLTransactionState runStatements(); 94 SQLTransactionState runStatements();
95 SQLTransactionState postflightAndCommit(); 95 SQLTransactionState postflightAndCommit();
96 SQLTransactionState cleanupAndTerminate(); 96 SQLTransactionState cleanupAndTerminate();
97 SQLTransactionState cleanupAfterTransactionErrorCallback(); 97 SQLTransactionState cleanupAfterTransactionErrorCallback();
98 98
(...skipping 24 matching lines...) Expand all
123 123
124 Mutex m_statementMutex; 124 Mutex m_statementMutex;
125 HeapDeque<Member<SQLStatementBackend>> m_statementQueue; 125 HeapDeque<Member<SQLStatementBackend>> m_statementQueue;
126 126
127 OwnPtr<SQLiteTransaction> m_sqliteTransaction; 127 OwnPtr<SQLiteTransaction> m_sqliteTransaction;
128 }; 128 };
129 129
130 } // namespace blink 130 } // namespace blink
131 131
132 #endif // SQLTransactionBackend_h 132 #endif // SQLTransactionBackend_h
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/SQLTransaction.h ('k') | Source/modules/webgl/ANGLEInstancedArrays.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698