summaryrefslogtreecommitdiffstats
path: root/chromium/sync/syncable/syncable_read_transaction.h
blob: 2b9729d4662d8aee840499a92a94a19c68753306 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SYNC_SYNCABLE_SYNCABLE_READ_TRANSACTION_H_
#define SYNC_SYNCABLE_SYNCABLE_READ_TRANSACTION_H_

#include "sync/base/sync_export.h"
#include "sync/syncable/syncable_base_transaction.h"

namespace syncer {
class ReadTransaction;
namespace syncable {

// Locks db in constructor, unlocks in destructor.
class SYNC_EXPORT ReadTransaction : public BaseTransaction {
 public:
  ReadTransaction(const tracked_objects::Location& from_here,
                  Directory* directory);

  virtual ~ReadTransaction();

 protected:  // Don't allow creation on heap, except by sync API wrapper.
  friend class syncer::ReadTransaction;
  void* operator new(size_t size) { return (::operator new)(size); }

  DISALLOW_COPY_AND_ASSIGN(ReadTransaction);
};

}  // namespace syncable
}  // namespace syncer

#endif  // SYNC_SYNCABLE_SYNCABLE_READ_TRANSACTION_H_