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

Side by Side Diff: Source/modules/webdatabase/DatabaseSync.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
« no previous file with comments | « no previous file | Source/modules/webdatabase/DatabaseSync.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 { 69 {
70 setLastErrorMessage(String::format("%s (%d, %s)", message, sqliteCode, s qliteMessage)); 70 setLastErrorMessage(String::format("%s (%d, %s)", message, sqliteCode, s qliteMessage));
71 } 71 }
72 72
73 private: 73 private:
74 DatabaseSync(PassRefPtr<DatabaseContext>, const String& name, 74 DatabaseSync(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 static PassRefPtrWillBeRawPtr<DatabaseSync> create(ExecutionContext*, PassRe fPtrWillBeRawPtr<DatabaseBackendBase>); 76 static PassRefPtrWillBeRawPtr<DatabaseSync> create(ExecutionContext*, PassRe fPtrWillBeRawPtr<DatabaseBackendBase>);
77 77
78 void runTransaction(PassOwnPtr<SQLTransactionSyncCallback>, bool readOnly, E xceptionState&); 78 void runTransaction(PassOwnPtr<SQLTransactionSyncCallback>, bool readOnly, E xceptionState&);
79 void rollbackTransaction(PassRefPtr<SQLTransactionSync>); 79 void rollbackTransaction(SQLTransactionSync&);
80 80
81 String m_lastErrorMessage; 81 String m_lastErrorMessage;
82 82
83 friend class DatabaseManager; 83 friend class DatabaseManager;
84 friend class DatabaseServer; // FIXME: remove this when the backend has been split out. 84 friend class DatabaseServer; // FIXME: remove this when the backend has been split out.
85
86 #if ENABLE(OILPAN)
87 public:
88 void registerTransaction(SQLTransactionSync*);
89
90 private:
91 class TransactionObserver {
92 public:
93 TransactionObserver(SQLTransactionSync* sync) : m_sync(sync) { }
94 ~TransactionObserver();
zerny-chromium 2014/03/17 09:27:00 private:
95 SQLTransactionSync* m_sync;
96 };
97
98 typedef PersistentHeapHashMap<WeakMember<SQLTransactionSync>, OwnPtr<Transac tionObserver> > ObserverMap;
99 GC_PLUGIN_IGNORE("http://crbug.com/353083")
100 ObserverMap m_observers;
101 #endif
102
85 }; 103 };
86 104
87 } // namespace WebCore 105 } // namespace WebCore
88 106
89 #endif 107 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/modules/webdatabase/DatabaseSync.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698