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

Unified Diff: sync/syncable/syncable_base_transaction.h

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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 | « sync/syncable/syncable-inl.h ('k') | sync/syncable/syncable_base_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/syncable_base_transaction.h
diff --git a/sync/syncable/syncable_base_transaction.h b/sync/syncable/syncable_base_transaction.h
deleted file mode 100644
index a6b1f491d628e43b1f80645ed82032c1711383fe..0000000000000000000000000000000000000000
--- a/sync/syncable/syncable_base_transaction.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// 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_BASE_TRANSACTION_H_
-#define SYNC_SYNCABLE_SYNCABLE_BASE_TRANSACTION_H_
-
-#include <string>
-
-#include "base/location.h"
-#include "base/macros.h"
-#include "sync/base/sync_export.h"
-#include "sync/syncable/syncable_id.h"
-
-namespace syncer {
-namespace syncable {
-
-class Directory;
-
-// A WriteTransaction has a writer tag describing which body of code is doing
-// the write. This is defined up here since WriteTransactionInfo also contains
-// one.
-enum WriterTag {
- INVALID,
- SYNCER,
- AUTHWATCHER,
- UNITTEST,
- VACUUM_AFTER_SAVE,
- HANDLE_SAVE_FAILURE,
- PURGE_ENTRIES,
- SYNCAPI,
-};
-
-// Make sure to update this if you update WriterTag.
-std::string WriterTagToString(WriterTag writer_tag);
-
-class SYNC_EXPORT BaseTransaction {
- public:
- static Id root_id();
-
- Directory* directory() const;
-
- virtual ~BaseTransaction();
-
- // This should be called when a database corruption is detected and there is
- // no way for us to recover short of wiping the database clean. When this is
- // called we set a bool in the transaction. The caller has to unwind the
- // stack. When the destructor for the transaction is called it acts upon the
- // bool and calls the Directory to handle the unrecoverable error.
- void OnUnrecoverableError(const tracked_objects::Location& location,
- const std::string& message);
-
- bool unrecoverable_error_set() const;
-
- protected:
- BaseTransaction(const tracked_objects::Location& from_here,
- const char* name,
- WriterTag writer,
- Directory* directory);
-
- void Lock();
- void Unlock();
-
- // This should be called before unlocking because it calls the Direcotry's
- // OnUnrecoverableError method which is not protected by locks and could
- // be called from any thread. Holding the transaction lock ensures only one
- // thread could call the method at a time.
- void HandleUnrecoverableErrorIfSet();
-
- const tracked_objects::Location from_here_;
- const char* const name_;
- WriterTag writer_;
- Directory* const directory_;
-
- // Error information.
- bool unrecoverable_error_set_;
- tracked_objects::Location unrecoverable_error_location_;
- std::string unrecoverable_error_msg_;
-
- private:
- friend class Entry;
- DISALLOW_COPY_AND_ASSIGN(BaseTransaction);
-};
-
-} // namespace syncable
-} // namespace syncer
-
-#endif // SYNC_SYNCABLE_SYNCABLE_BASE_TRANSACTION_H_
« no previous file with comments | « sync/syncable/syncable-inl.h ('k') | sync/syncable/syncable_base_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698