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

Unified Diff: chrome/browser/sync/syncable/syncable.h

Issue 2854059: Merge 53223 - Fix deadlock by introducing a new transaction event.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | chrome/browser/sync/syncable/syncable.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/syncable/syncable.h
===================================================================
--- chrome/browser/sync/syncable/syncable.h (revision 53274)
+++ chrome/browser/sync/syncable/syncable.h (working copy)
@@ -586,6 +586,10 @@
// callbacks or attempt to lock anything because a
// WriteTransaction is being held until the listener returns.
CALCULATE_CHANGES,
+ // Means the WriteTransaction is ending, and this is the absolute
+ // last chance to perform any read operations in the current transaction.
+ // It is not recommended that the listener perform any writes.
+ TRANSACTION_ENDING,
// Means the WriteTransaction has been released and the listener
// can now take action on the changes it calculated.
TRANSACTION_COMPLETE,
@@ -594,7 +598,7 @@
} todo;
// These members are only valid for CALCULATE_CHANGES.
const OriginalEntries* originals;
- BaseTransaction* trans;
+ BaseTransaction* trans; // This is valid also for TRANSACTION_ENDING
WriterTag writer;
typedef DirectoryChangeEvent EventType;
static inline bool IsChannelShutdownEvent(const EventType& e) {
@@ -1044,6 +1048,8 @@
inline Directory* directory() const { return directory_; }
inline Id root_id() const { return Id(); }
+ virtual ~BaseTransaction();
+
protected:
BaseTransaction(Directory* directory, const char* name,
const char* source_file, int line, WriterTag writer);
@@ -1072,7 +1078,7 @@
ReadTransaction(const ScopedDirLookup& scoped_dir,
const char* source_file, int line);
- ~ReadTransaction();
+ virtual ~ReadTransaction();
protected: // Don't allow creation on heap, except by sync API wrapper.
friend class sync_api::ReadTransaction;
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | chrome/browser/sync/syncable/syncable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698