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

Side by Side Diff: Source/modules/webdatabase/Database.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, 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 class SQLTransactionCallback; 47 class SQLTransactionCallback;
48 class SQLTransactionErrorCallback; 48 class SQLTransactionErrorCallback;
49 class SQLVoidCallback; 49 class SQLVoidCallback;
50 50
51 class Database : public DatabaseBase, public DatabaseBackend, public ScriptWrapp able { 51 class Database : public DatabaseBase, public DatabaseBackend, public ScriptWrapp able {
52 public: 52 public:
53 virtual ~Database(); 53 virtual ~Database();
54 54
55 // Direct support for the DOM API 55 // Direct support for the DOM API
56 virtual String version() const; 56 virtual String version() const;
57 void changeVersion(const String& oldVersion, const String& newVersion, PassR efPtr<SQLTransactionCallback>, PassRefPtr<SQLTransactionErrorCallback>, PassRefP tr<SQLVoidCallback> successCallback); 57 void changeVersion(const String& oldVersion, const String& newVersion, PassO wnPtr<SQLTransactionCallback>, PassOwnPtr<SQLTransactionErrorCallback>, PassOwnP tr<SQLVoidCallback> successCallback);
58 void transaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransacti onErrorCallback>, PassRefPtr<SQLVoidCallback> successCallback); 58 void transaction(PassOwnPtr<SQLTransactionCallback>, PassOwnPtr<SQLTransacti onErrorCallback>, PassOwnPtr<SQLVoidCallback> successCallback);
59 void readTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTrans actionErrorCallback>, PassRefPtr<SQLVoidCallback> successCallback); 59 void readTransaction(PassOwnPtr<SQLTransactionCallback>, PassOwnPtr<SQLTrans actionErrorCallback>, PassOwnPtr<SQLVoidCallback> successCallback);
60 60
61 // Internal engine support 61 // Internal engine support
62 static Database* from(DatabaseBackend*); 62 static Database* from(DatabaseBackend*);
63 DatabaseContext* databaseContext() const { return m_databaseContext.get(); } 63 DatabaseContext* databaseContext() const { return m_databaseContext.get(); }
64 64
65 Vector<String> tableNames(); 65 Vector<String> tableNames();
66 66
67 virtual SecurityOrigin* securityOrigin() const; 67 virtual SecurityOrigin* securityOrigin() const;
68 68
69 virtual void closeImmediately(); 69 virtual void closeImmediately();
70 70
71 void scheduleTransactionCallback(SQLTransaction*); 71 void scheduleTransactionCallback(SQLTransaction*);
72 72
73 private: 73 private:
74 Database(PassRefPtr<DatabaseContext>, const String& name, 74 Database(PassRefPtr<DatabaseContext>, const String& name,
75 const String& expectedVersion, const String& displayName, unsigned long estimatedSize); 75 const String& expectedVersion, const String& displayName, unsigned long estimatedSize);
76 PassRefPtr<DatabaseBackend> backend(); 76 PassRefPtr<DatabaseBackend> backend();
77 static PassRefPtr<Database> create(ExecutionContext*, PassRefPtr<DatabaseBac kendBase>); 77 static PassRefPtr<Database> create(ExecutionContext*, PassRefPtr<DatabaseBac kendBase>);
78 78
79 void runTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransa ctionErrorCallback>, 79 void runTransaction(PassOwnPtr<SQLTransactionCallback>, PassOwnPtr<SQLTransa ctionErrorCallback>,
80 PassRefPtr<SQLVoidCallback> successCallback, bool readOnly, const Change VersionData* = 0); 80 PassOwnPtr<SQLVoidCallback> successCallback, bool readOnly, const Change VersionData* = 0);
81 81
82 Vector<String> performGetTableNames(); 82 Vector<String> performGetTableNames();
83 83
84 void reportStartTransactionResult(int errorSite, int webSqlErrorCode, int sq liteErrorCode); 84 void reportStartTransactionResult(int errorSite, int webSqlErrorCode, int sq liteErrorCode);
85 void reportCommitTransactionResult(int errorSite, int webSqlErrorCode, int s qliteErrorCode); 85 void reportCommitTransactionResult(int errorSite, int webSqlErrorCode, int s qliteErrorCode);
86 86
87 RefPtr<SecurityOrigin> m_databaseThreadSecurityOrigin; 87 RefPtr<SecurityOrigin> m_databaseThreadSecurityOrigin;
88 RefPtr<DatabaseContext> m_databaseContext; 88 RefPtr<DatabaseContext> m_databaseContext;
89 89
90 friend class DatabaseManager; 90 friend class DatabaseManager;
91 friend class DatabaseServer; // FIXME: remove this when the backend has been split out. 91 friend class DatabaseServer; // FIXME: remove this when the backend has been split out.
92 friend class DatabaseBackend; // FIXME: remove this when the backend has bee n split out. 92 friend class DatabaseBackend; // FIXME: remove this when the backend has bee n split out.
93 friend class SQLStatement; 93 friend class SQLStatement;
94 friend class SQLTransaction; 94 friend class SQLTransaction;
95 }; 95 };
96 96
97 } // namespace WebCore 97 } // namespace WebCore
98 98
99 #endif // Database_h 99 #endif // Database_h
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/DOMWindowWebDatabase.cpp ('k') | Source/modules/webdatabase/Database.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698