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

Unified Diff: chrome/browser/sync/internal_api/base_transaction.cc

Issue 7633077: Refactor syncapi.h (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: This patch has compiled from a clean build Created 9 years, 4 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/internal_api/base_transaction.h ('k') | chrome/browser/sync/internal_api/read_node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/internal_api/base_transaction.cc
diff --git a/chrome/browser/sync/internal_api/base_transaction.cc b/chrome/browser/sync/internal_api/base_transaction.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8d26702442f783f108041fa4696359849f88a2aa
--- /dev/null
+++ b/chrome/browser/sync/internal_api/base_transaction.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2011 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.
+
+#include "base_transaction.h"
+
+#include "chrome/browser/sync/syncable/directory_manager.h"
+#include "chrome/browser/sync/util/cryptographer.h"
+
+using browser_sync::Cryptographer;
+
+namespace sync_api {
+
+//////////////////////////////////////////////////////////////////////////
+// BaseTransaction member definitions
+BaseTransaction::BaseTransaction(UserShare* share)
+ : lookup_(NULL) {
+ DCHECK(share && share->dir_manager.get());
+ lookup_ = new syncable::ScopedDirLookup(share->dir_manager.get(),
+ share->name);
+ cryptographer_ = share->dir_manager->GetCryptographer(this);
+ if (!(lookup_->good()))
+ DCHECK(false) << "ScopedDirLookup failed on valid DirManager.";
+}
+BaseTransaction::~BaseTransaction() {
+ delete lookup_;
+}
+
+syncable::ModelTypeSet GetEncryptedTypes(
+ const sync_api::BaseTransaction* trans) {
+ Cryptographer* cryptographer = trans->GetCryptographer();
+ return cryptographer->GetEncryptedTypes();
+}
+
+} // namespace sync_api
« no previous file with comments | « chrome/browser/sync/internal_api/base_transaction.h ('k') | chrome/browser/sync/internal_api/read_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698