| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/invalidation/invalidation_service_android.h" | 5 #include "chrome/browser/invalidation/invalidation_service_android.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "content/public/browser/notification_service.h" | 8 #include "content/public/browser/notification_service.h" |
| 9 | 9 |
| 10 namespace invalidation { | 10 namespace invalidation { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 DCHECK(CalledOnValidThread()); | 63 DCHECK(CalledOnValidThread()); |
| 64 DCHECK_EQ(type, chrome::NOTIFICATION_SYNC_REFRESH_REMOTE); | 64 DCHECK_EQ(type, chrome::NOTIFICATION_SYNC_REFRESH_REMOTE); |
| 65 | 65 |
| 66 content::Details<const syncer::ObjectIdInvalidationMap> | 66 content::Details<const syncer::ObjectIdInvalidationMap> |
| 67 state_details(details); | 67 state_details(details); |
| 68 const syncer::ObjectIdInvalidationMap object_invalidation_map = | 68 const syncer::ObjectIdInvalidationMap object_invalidation_map = |
| 69 *(state_details.ptr()); | 69 *(state_details.ptr()); |
| 70 | 70 |
| 71 // An empty map implies that we should invalidate all. | 71 // An empty map implies that we should invalidate all. |
| 72 const syncer::ObjectIdInvalidationMap& effective_invalidation_map = | 72 const syncer::ObjectIdInvalidationMap& effective_invalidation_map = |
| 73 object_invalidation_map.empty() ? | 73 object_invalidation_map.Empty() ? |
| 74 ObjectIdSetToInvalidationMap( | 74 syncer::ObjectIdInvalidationMap::InvalidateAll( |
| 75 invalidator_registrar_.GetAllRegisteredIds(), | 75 invalidator_registrar_.GetAllRegisteredIds()) : |
| 76 syncer::Invalidation::kUnknownVersion, | |
| 77 std::string()) : | |
| 78 object_invalidation_map; | 76 object_invalidation_map; |
| 79 | 77 |
| 80 invalidator_registrar_.DispatchInvalidationsToHandlers( | 78 invalidator_registrar_.DispatchInvalidationsToHandlers( |
| 81 effective_invalidation_map); | 79 effective_invalidation_map); |
| 82 } | 80 } |
| 83 | 81 |
| 84 void InvalidationServiceAndroid::TriggerStateChangeForTest( | 82 void InvalidationServiceAndroid::TriggerStateChangeForTest( |
| 85 syncer::InvalidatorState state) { | 83 syncer::InvalidatorState state) { |
| 86 DCHECK(CalledOnValidThread()); | 84 DCHECK(CalledOnValidThread()); |
| 87 invalidator_state_ = state; | 85 invalidator_state_ = state; |
| 88 invalidator_registrar_.UpdateInvalidatorState(invalidator_state_); | 86 invalidator_registrar_.UpdateInvalidatorState(invalidator_state_); |
| 89 } | 87 } |
| 90 | 88 |
| 91 } // namespace invalidation | 89 } // namespace invalidation |
| OLD | NEW |