| 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 "content/browser/geofencing/geofencing_service.h" | 5 #include "content/browser/geofencing/geofencing_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 Registration::STATE_SHOULD_UNREGISTER_AND_DELETE; | 133 Registration::STATE_SHOULD_UNREGISTER_AND_DELETE; |
| 134 break; | 134 break; |
| 135 case Registration::STATE_SHOULD_UNREGISTER_AND_DELETE: | 135 case Registration::STATE_SHOULD_UNREGISTER_AND_DELETE: |
| 136 // Should not happen. | 136 // Should not happen. |
| 137 NOTREACHED(); | 137 NOTREACHED(); |
| 138 break; | 138 break; |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 | 141 |
| 142 void GeofencingServiceImpl::SetProviderForTesting( | 142 void GeofencingServiceImpl::SetProviderForTesting( |
| 143 scoped_ptr<GeofencingProvider> provider) { | 143 std::unique_ptr<GeofencingProvider> provider) { |
| 144 DCHECK(!provider_.get()); | 144 DCHECK(!provider_.get()); |
| 145 provider_ = std::move(provider); | 145 provider_ = std::move(provider); |
| 146 } | 146 } |
| 147 | 147 |
| 148 int GeofencingServiceImpl::RegistrationCountForTesting() { | 148 int GeofencingServiceImpl::RegistrationCountForTesting() { |
| 149 return registrations_.size(); | 149 return registrations_.size(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool GeofencingServiceImpl::EnsureProvider() { | 152 bool GeofencingServiceImpl::EnsureProvider() { |
| 153 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 153 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 registration_iterator->second.delegate->RegistrationFinished( | 194 registration_iterator->second.delegate->RegistrationFinished( |
| 195 geofencing_registration_id, status); | 195 geofencing_registration_id, status); |
| 196 | 196 |
| 197 if (status != GEOFENCING_STATUS_OK) { | 197 if (status != GEOFENCING_STATUS_OK) { |
| 198 // Registration failed, remove from our book-keeping. | 198 // Registration failed, remove from our book-keeping. |
| 199 registrations_.erase(registration_iterator); | 199 registrations_.erase(registration_iterator); |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace content | 203 } // namespace content |
| OLD | NEW |