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

Unified Diff: chrome/browser/sync/engine/get_commit_ids_command.cc

Issue 7806005: Revert 98770 - Merge 98758 - [Sync] Gracefully handle writing to a node when the cryptographer is... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/835/src/
Patch Set: 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/engine/get_commit_ids_command.h ('k') | chrome/browser/sync/engine/syncapi.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/get_commit_ids_command.cc
===================================================================
--- chrome/browser/sync/engine/get_commit_ids_command.cc (revision 98772)
+++ chrome/browser/sync/engine/get_commit_ids_command.cc (working copy)
@@ -8,11 +8,8 @@
#include <utility>
#include <vector>
-#include "chrome/browser/sync/engine/nigori_util.h"
#include "chrome/browser/sync/engine/syncer_util.h"
-#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/syncable/syncable.h"
-#include "chrome/browser/sync/util/cryptographer.h"
using std::set;
using std::vector;
@@ -34,15 +31,6 @@
syncable::Directory::UnsyncedMetaHandles all_unsynced_handles;
SyncerUtil::GetUnsyncedEntries(session->write_transaction(),
&all_unsynced_handles);
-
- Cryptographer *cryptographer =
- session->context()->directory_manager()->GetCryptographer(
- session->write_transaction());
- if (cryptographer) {
- FilterEntriesNeedingEncryption(cryptographer->GetEncryptedTypes(),
- session->write_transaction(),
- &all_unsynced_handles);
- }
StatusController* status = session->status_controller();
status->set_unsynced_handles(all_unsynced_handles);
@@ -58,37 +46,6 @@
status->set_commit_set(*ordered_commit_set_.get());
}
-// We create a new list of unsynced handles which omits all handles to entries
-// that require encryption but are written in plaintext. If any were found we
-// overwrite |unsynced_handles| with this new list, else no change is made.
-// Static.
-void GetCommitIdsCommand::FilterEntriesNeedingEncryption(
- const syncable::ModelTypeSet& encrypted_types,
- syncable::BaseTransaction* trans,
- syncable::Directory::UnsyncedMetaHandles* unsynced_handles) {
- bool removed_handles = false;
- syncable::Directory::UnsyncedMetaHandles::iterator iter;
- syncable::Directory::UnsyncedMetaHandles new_unsynced_handles;
- new_unsynced_handles.reserve(unsynced_handles->size());
- // TODO(zea): If this becomes a bottleneck, we should merge this loop into the
- // AddCreatesAndMoves and AddDeletes loops.
- for (iter = unsynced_handles->begin();
- iter != unsynced_handles->end();
- ++iter) {
- syncable::Entry entry(trans, syncable::GET_BY_HANDLE, *iter);
- if (syncable::EntryNeedsEncryption(encrypted_types, entry)) {
- // This entry requires encryption but is not encrypted (possibly due to
- // the cryptographer not being initialized). Don't add it to our new list
- // of unsynced handles.
- removed_handles = true;
- } else {
- new_unsynced_handles.push_back(*iter);
- }
- }
- if (removed_handles)
- *unsynced_handles = new_unsynced_handles;
-}
-
void GetCommitIdsCommand::AddUncommittedParentsAndTheirPredecessors(
syncable::BaseTransaction* trans,
syncable::Id parent_id,
« no previous file with comments | « chrome/browser/sync/engine/get_commit_ids_command.h ('k') | chrome/browser/sync/engine/syncapi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698