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

Side by Side Diff: chrome/browser/sync/test/integration/p2p_invalidation_forwarder.cc

Issue 403103002: Prep for moving files into components/invalidation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/integration/p2p_invalidation_forwarder.h" 5 #include "chrome/browser/sync/test/integration/p2p_invalidation_forwarder.h"
6 6
7 #include "chrome/browser/sync/glue/invalidation_helper.h"
7 #include "chrome/browser/sync/profile_sync_service.h" 8 #include "chrome/browser/sync/profile_sync_service.h"
8 #include "components/invalidation/p2p_invalidation_service.h" 9 #include "components/invalidation/p2p_invalidation_service.h"
9 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" 10 #include "sync/internal_api/public/sessions/sync_session_snapshot.h"
10 11
11 P2PInvalidationForwarder::P2PInvalidationForwarder( 12 P2PInvalidationForwarder::P2PInvalidationForwarder(
12 ProfileSyncService* sync_service, 13 ProfileSyncService* sync_service,
13 invalidation::P2PInvalidationService* invalidation_service) 14 invalidation::P2PInvalidationService* invalidation_service)
14 : sync_service_(sync_service), 15 : sync_service_(sync_service),
15 invalidation_service_(invalidation_service) { 16 invalidation_service_(invalidation_service) {
16 sync_service_->AddObserver(this); 17 sync_service_->AddObserver(this);
(...skipping 10 matching lines...) Expand all
27 sync_service_->GetLastSessionSnapshot(); 28 sync_service_->GetLastSessionSnapshot();
28 bool is_notifiable_commit = 29 bool is_notifiable_commit =
29 (snap.model_neutral_state().num_successful_commits > 0); 30 (snap.model_neutral_state().num_successful_commits > 0);
30 if (is_notifiable_commit && invalidation_service_) { 31 if (is_notifiable_commit && invalidation_service_) {
31 syncer::ModelTypeSet model_types = 32 syncer::ModelTypeSet model_types =
32 snap.model_neutral_state().commit_request_types; 33 snap.model_neutral_state().commit_request_types;
33 syncer::ObjectIdSet ids = ModelTypeSetToObjectIdSet(model_types); 34 syncer::ObjectIdSet ids = ModelTypeSetToObjectIdSet(model_types);
34 invalidation_service_->SendInvalidation(ids); 35 invalidation_service_->SendInvalidation(ids);
35 } 36 }
36 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698