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

Side by Side Diff: chrome/browser/sync/glue/password_change_processor.cc

Issue 9460047: sync: remove use of protobuf extensions in protocol to reduce static init overhead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fred's review Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/glue/password_change_processor.h" 5 #include "chrome/browser/sync/glue/password_change_processor.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return; 168 return;
169 } 169 }
170 170
171 DCHECK(deleted_passwords_.empty() && new_passwords_.empty() && 171 DCHECK(deleted_passwords_.empty() && new_passwords_.empty() &&
172 updated_passwords_.empty()); 172 updated_passwords_.empty());
173 173
174 for (sync_api::ChangeRecordList::const_iterator it = 174 for (sync_api::ChangeRecordList::const_iterator it =
175 changes.Get().begin(); it != changes.Get().end(); ++it) { 175 changes.Get().begin(); it != changes.Get().end(); ++it) {
176 if (sync_api::ChangeRecord::ACTION_DELETE == 176 if (sync_api::ChangeRecord::ACTION_DELETE ==
177 it->action) { 177 it->action) {
178 DCHECK(it->specifics.HasExtension(sync_pb::password)) 178 DCHECK(it->specifics.has_password())
179 << "Password specifics data not present on delete!"; 179 << "Password specifics data not present on delete!";
180 DCHECK(it->extra.get()); 180 DCHECK(it->extra.get());
181 sync_api::ExtraPasswordChangeRecordData* extra = 181 sync_api::ExtraPasswordChangeRecordData* extra =
182 it->extra.get(); 182 it->extra.get();
183 const sync_pb::PasswordSpecificsData& password = extra->unencrypted(); 183 const sync_pb::PasswordSpecificsData& password = extra->unencrypted();
184 webkit::forms::PasswordForm form; 184 webkit::forms::PasswordForm form;
185 PasswordModelAssociator::CopyPassword(password, &form); 185 PasswordModelAssociator::CopyPassword(password, &form);
186 deleted_passwords_.push_back(form); 186 deleted_passwords_.push_back(form);
187 model_associator_->Disassociate(it->id); 187 model_associator_->Disassociate(it->id);
188 continue; 188 continue;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 254
255 void PasswordChangeProcessor::StopObserving() { 255 void PasswordChangeProcessor::StopObserving() {
256 DCHECK(expected_loop_ == MessageLoop::current()); 256 DCHECK(expected_loop_ == MessageLoop::current());
257 notification_registrar_.Remove( 257 notification_registrar_.Remove(
258 this, 258 this,
259 chrome::NOTIFICATION_LOGINS_CHANGED, 259 chrome::NOTIFICATION_LOGINS_CHANGED,
260 content::Source<PasswordStore>(password_store_)); 260 content::Source<PasswordStore>(password_store_));
261 } 261 }
262 262
263 } // namespace browser_sync 263 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/verify_updates_command_unittest.cc ('k') | chrome/browser/sync/glue/session_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698