Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_READ_TRANSACTION_H_ | |
| 6 #define CHROME_BROWSER_SYNC_ENGINE_READ_TRANSACTION_H_ | |
| 7 | |
| 8 #include "chrome/browser/sync/engine/base_transaction.h" | |
| 9 | |
| 10 namespace tracked_objects { | |
| 11 class Location; | |
| 12 } // namespace tracked_objects | |
|
tim (not reviewing)
2011/08/15 22:53:55
Well, you can remove this since it is inline below
rlarocque
2011/08/16 18:12:46
Remove the forward declaration? I don't see how t
| |
| 13 | |
| 14 namespace sync_api { | |
| 15 | |
| 16 class UserShare; | |
| 17 | |
| 18 // TODO(akalin): Make ReadTransaction/WriteTransaction take a Location | |
| 19 // parameter. | |
|
tim (not reviewing)
2011/08/15 22:53:55
Think you can remove this todo.
rlarocque
2011/08/16 18:12:46
Done.
| |
| 20 | |
| 21 // Sync API's ReadTransaction is a read-only BaseTransaction. It wraps | |
| 22 // a syncable::ReadTransaction. | |
| 23 class ReadTransaction : public BaseTransaction { | |
| 24 public: | |
| 25 // Start a new read-only transaction on the specified repository. | |
| 26 ReadTransaction(const tracked_objects::Location& from_here, | |
| 27 UserShare* share); | |
| 28 | |
| 29 // Resume the middle of a transaction. Will not close transaction. | |
| 30 ReadTransaction(UserShare* share, syncable::BaseTransaction* trans); | |
| 31 | |
| 32 virtual ~ReadTransaction(); | |
| 33 | |
| 34 // BaseTransaction override. | |
| 35 virtual syncable::BaseTransaction* GetWrappedTrans() const; | |
| 36 private: | |
| 37 void* operator new(size_t size); // Transaction is meant for stack use only. | |
| 38 | |
| 39 // The underlying syncable object which this class wraps. | |
| 40 syncable::BaseTransaction* transaction_; | |
| 41 bool close_transaction_; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(ReadTransaction); | |
| 44 }; | |
| 45 | |
| 46 } // namespace sync_api | |
|
tim (not reviewing)
2011/08/15 22:53:55
Perhaps we should change this to be
browser_sync:
rlarocque
2011/08/16 18:12:46
I was thinking about that, but then I figured this
| |
| 47 | |
| 48 #endif // CHROME_BROWSER_SYNC_ENGINE_READ_TRANSACTION_H_ | |
| OLD | NEW |