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

Side by Side Diff: chrome/browser/sync/glue/session_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/session_change_processor.h" 5 #include "chrome/browser/sync/glue/session_change_processor.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 for (sync_api::ChangeRecordList::const_iterator it = 257 for (sync_api::ChangeRecordList::const_iterator it =
258 changes.Get().begin(); it != changes.Get().end(); ++it) { 258 changes.Get().begin(); it != changes.Get().end(); ++it) {
259 const sync_api::ChangeRecord& change = *it; 259 const sync_api::ChangeRecord& change = *it;
260 sync_api::ChangeRecord::Action action(change.action); 260 sync_api::ChangeRecord::Action action(change.action);
261 if (sync_api::ChangeRecord::ACTION_DELETE == action) { 261 if (sync_api::ChangeRecord::ACTION_DELETE == action) {
262 // Deletions are all or nothing (since we only ever delete entire 262 // Deletions are all or nothing (since we only ever delete entire
263 // sessions). Therefore we don't care if it's a tab node or meta node, 263 // sessions). Therefore we don't care if it's a tab node or meta node,
264 // and just ensure we've disassociated. 264 // and just ensure we've disassociated.
265 DCHECK_EQ(syncable::GetModelTypeFromSpecifics(it->specifics), 265 DCHECK_EQ(syncable::GetModelTypeFromSpecifics(it->specifics),
266 syncable::SESSIONS); 266 syncable::SESSIONS);
267 const sync_pb::SessionSpecifics& specifics = 267 const sync_pb::SessionSpecifics& specifics = it->specifics.session();
268 it->specifics.GetExtension(sync_pb::session);
269 session_model_associator_->DisassociateForeignSession( 268 session_model_associator_->DisassociateForeignSession(
270 specifics.session_tag()); 269 specifics.session_tag());
271 continue; 270 continue;
272 } 271 }
273 272
274 // Handle an update or add. 273 // Handle an update or add.
275 sync_api::ReadNode sync_node(trans); 274 sync_api::ReadNode sync_node(trans);
276 if (!sync_node.InitByIdLookup(change.id)) { 275 if (!sync_node.InitByIdLookup(change.id)) {
277 error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE, 276 error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE,
278 "Session node lookup failed."); 277 "Session node lookup failed.");
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 content::NotificationService::AllBrowserContextsAndSources()); 342 content::NotificationService::AllBrowserContextsAndSources());
344 } 343 }
345 344
346 void SessionChangeProcessor::StopObserving() { 345 void SessionChangeProcessor::StopObserving() {
347 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 346 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
348 DCHECK(profile_); 347 DCHECK(profile_);
349 notification_registrar_.RemoveAll(); 348 notification_registrar_.RemoveAll();
350 } 349 }
351 350
352 } // namespace browser_sync 351 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/password_change_processor.cc ('k') | chrome/browser/sync/glue/typed_url_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698