| OLD | NEW |
| 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 "components/invalidation/sync_invalidation_listener.h" | 5 #include "components/invalidation/sync_invalidation_listener.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // The Storage resource is implemented as a write-through cache. We populate | 66 // The Storage resource is implemented as a write-through cache. We populate |
| 67 // it with the initial state on startup, so subsequent writes go to disk and | 67 // it with the initial state on startup, so subsequent writes go to disk and |
| 68 // update the in-memory cache, while reads just return the cached state. | 68 // update the in-memory cache, while reads just return the cached state. |
| 69 sync_system_resources_.storage()->SetInitialState( | 69 sync_system_resources_.storage()->SetInitialState( |
| 70 invalidation_bootstrap_data); | 70 invalidation_bootstrap_data); |
| 71 | 71 |
| 72 unacked_invalidations_map_ = initial_unacked_invalidations; | 72 unacked_invalidations_map_ = initial_unacked_invalidations; |
| 73 invalidation_state_tracker_ = invalidation_state_tracker; | 73 invalidation_state_tracker_ = invalidation_state_tracker; |
| 74 invalidation_state_tracker_task_runner_ = | 74 invalidation_state_tracker_task_runner_ = |
| 75 invalidation_state_tracker_task_runner; | 75 invalidation_state_tracker_task_runner; |
| 76 DCHECK(invalidation_state_tracker_task_runner_); | 76 DCHECK(invalidation_state_tracker_task_runner_.get()); |
| 77 | 77 |
| 78 DCHECK(!delegate_); | 78 DCHECK(!delegate_); |
| 79 DCHECK(delegate); | 79 DCHECK(delegate); |
| 80 delegate_ = delegate; | 80 delegate_ = delegate; |
| 81 | 81 |
| 82 invalidation_client_.reset(create_invalidation_client_callback.Run( | 82 invalidation_client_.reset(create_invalidation_client_callback.Run( |
| 83 &sync_system_resources_, | 83 &sync_system_resources_, |
| 84 sync_network_channel_->GetInvalidationClientType(), | 84 sync_network_channel_->GetInvalidationClientType(), |
| 85 client_id, | 85 client_id, |
| 86 kApplicationName, | 86 kApplicationName, |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 } | 448 } |
| 449 | 449 |
| 450 void SyncInvalidationListener::OnNetworkChannelStateChanged( | 450 void SyncInvalidationListener::OnNetworkChannelStateChanged( |
| 451 InvalidatorState invalidator_state) { | 451 InvalidatorState invalidator_state) { |
| 452 DCHECK(CalledOnValidThread()); | 452 DCHECK(CalledOnValidThread()); |
| 453 push_client_state_ = invalidator_state; | 453 push_client_state_ = invalidator_state; |
| 454 EmitStateChange(); | 454 EmitStateChange(); |
| 455 } | 455 } |
| 456 | 456 |
| 457 } // namespace syncer | 457 } // namespace syncer |
| OLD | NEW |