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

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

Issue 103473002: Manage WebSQL callbacks with OwnPtr instead of refcounting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix RefPtr/OwnPtr transition gcc errors Created 7 years 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 class SQLError; 45 class SQLError;
46 class SQLStatementCallback; 46 class SQLStatementCallback;
47 class SQLStatementErrorCallback; 47 class SQLStatementErrorCallback;
48 class SQLTransactionCallback; 48 class SQLTransactionCallback;
49 class SQLTransactionErrorCallback; 49 class SQLTransactionErrorCallback;
50 class SQLValue; 50 class SQLValue;
51 class SQLVoidCallback; 51 class SQLVoidCallback;
52 52
53 class SQLTransaction : public SQLTransactionStateMachine<SQLTransaction>, public AbstractSQLTransaction, public ScriptWrappable { 53 class SQLTransaction : public SQLTransactionStateMachine<SQLTransaction>, public AbstractSQLTransaction, public ScriptWrappable {
54 public: 54 public:
55 static PassRefPtr<SQLTransaction> create(Database*, PassRefPtr<SQLTransactio nCallback>, 55 static PassRefPtr<SQLTransaction> create(Database*, PassOwnPtr<SQLTransactio nCallback>,
56 PassRefPtr<SQLVoidCallback> successCallback, PassRefPtr<SQLTransactionEr rorCallback>, 56 PassOwnPtr<SQLVoidCallback> successCallback, PassOwnPtr<SQLTransactionEr rorCallback>,
57 bool readOnly); 57 bool readOnly);
58 58
59 void performPendingCallback(); 59 void performPendingCallback();
60 60
61 void executeSQL(const String& sqlStatement, const Vector<SQLValue>& argument s, 61 void executeSQL(const String& sqlStatement, const Vector<SQLValue>& argument s,
62 PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>, ExceptionState&); 62 PassOwnPtr<SQLStatementCallback>, PassOwnPtr<SQLStatementErrorCallback>, ExceptionState&);
63 63
64 Database* database() { return m_database.get(); } 64 Database* database() { return m_database.get(); }
65 65
66 PassOwnPtr<SQLTransactionErrorCallback> releaseErrorCallback();
67
66 private: 68 private:
67 SQLTransaction(Database*, PassRefPtr<SQLTransactionCallback>, 69 SQLTransaction(Database*, PassOwnPtr<SQLTransactionCallback>,
68 PassRefPtr<SQLVoidCallback> successCallback, PassRefPtr<SQLTransactionEr rorCallback>, 70 PassOwnPtr<SQLVoidCallback> successCallback, PassOwnPtr<SQLTransactionEr rorCallback>,
69 bool readOnly); 71 bool readOnly);
70 72
71 void clearCallbackWrappers(); 73 void clearCallbackWrappers();
72 74
73 // APIs called from the backend published via AbstractSQLTransaction: 75 // APIs called from the backend published via AbstractSQLTransaction:
74 virtual void requestTransitToState(SQLTransactionState) OVERRIDE; 76 virtual void requestTransitToState(SQLTransactionState) OVERRIDE;
75 virtual bool hasCallback() const OVERRIDE; 77 virtual bool hasCallback() const OVERRIDE;
76 virtual bool hasSuccessCallback() const OVERRIDE; 78 virtual bool hasSuccessCallback() const OVERRIDE;
77 virtual bool hasErrorCallback() const OVERRIDE; 79 virtual bool hasErrorCallback() const OVERRIDE;
78 virtual void setBackend(AbstractSQLTransactionBackend*) OVERRIDE; 80 virtual void setBackend(AbstractSQLTransactionBackend*) OVERRIDE;
(...skipping 22 matching lines...) Expand all
101 103
102 bool m_executeSqlAllowed; 104 bool m_executeSqlAllowed;
103 RefPtr<SQLError> m_transactionError; 105 RefPtr<SQLError> m_transactionError;
104 106
105 bool m_readOnly; 107 bool m_readOnly;
106 }; 108 };
107 109
108 } // namespace WebCore 110 } // namespace WebCore
109 111
110 #endif // SQLTransaction_h 112 #endif // SQLTransaction_h
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/SQLStatementErrorCallback.h ('k') | Source/modules/webdatabase/SQLTransaction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698