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

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

Issue 6465005: [Sync] Initial support for encrypting any datatype (no UI hookup yet). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 9 years, 10 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
Index: chrome/browser/sync/syncable/syncable.cc
diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc
index ac66083cc5f61a3b56fd3cb00697d9e30b78143e..c3e587c0e49151cc0b46309316c537d07c1c56b6 100644
--- a/chrome/browser/sync/syncable/syncable.cc
+++ b/chrome/browser/sync/syncable/syncable.cc
@@ -38,10 +38,6 @@
#include "base/time.h"
#include "chrome/browser/sync/engine/syncer.h"
#include "chrome/browser/sync/engine/syncer_util.h"
-#include "chrome/browser/sync/protocol/autofill_specifics.pb.h"
-#include "chrome/browser/sync/protocol/bookmark_specifics.pb.h"
-#include "chrome/browser/sync/protocol/password_specifics.pb.h"
-#include "chrome/browser/sync/protocol/preference_specifics.pb.h"
#include "chrome/browser/sync/protocol/service_constants.h"
#include "chrome/browser/sync/protocol/theme_specifics.pb.h"
#include "chrome/browser/sync/protocol/typed_url_specifics.pb.h"
@@ -278,6 +274,12 @@ DirectoryBackingStore* Directory::CreateBackingStore(
return new DirectoryBackingStore(dir_name, backing_filepath);
}
+void Directory::SetEncryptedDataTypes(const ModelTypeSet& encrypted_types) {
+ // Sanity check, passwords should always be encrypted.
+ DCHECK(encrypted_types.count(syncable::PASSWORDS) > 0);
+ kernel_->encrypted_datatypes = encrypted_types;
+}
+
DirOpenResult Directory::OpenImpl(const FilePath& file_path,
const string& name) {
DCHECK_EQ(static_cast<DirectoryBackingStore*>(NULL), store_);
@@ -1103,6 +1105,11 @@ BaseTransaction::BaseTransaction(Directory* directory)
BaseTransaction::~BaseTransaction() {}
+void BaseTransaction::SetEncryptedDataTypes(
+ const ModelTypeSet& encrypted_types) {
+ directory()->SetEncryptedDataTypes(encrypted_types);
+}
+
void BaseTransaction::UnlockAndLog(OriginalEntries* originals_arg) {
// Triggers the CALCULATE_CHANGES and TRANSACTION_ENDING events while
// holding dir_kernel_'s transaction_mutex and changes_channel mutex.

Powered by Google App Engine
This is Rietveld 408576698