OLD | NEW |
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/chromeos/settings/device_settings_service.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // short while. So we will retry such loads for up to 10 minutes. | 355 // short while. So we will retry such loads for up to 10 minutes. |
356 if (status == STORE_TEMP_VALIDATION_ERROR) { | 356 if (status == STORE_TEMP_VALIDATION_ERROR) { |
357 if (load_retries_left_ > 0) { | 357 if (load_retries_left_ > 0) { |
358 load_retries_left_--; | 358 load_retries_left_--; |
359 LOG(ERROR) << "A re-load has been scheduled due to a validation error."; | 359 LOG(ERROR) << "A re-load has been scheduled due to a validation error."; |
360 content::BrowserThread::PostDelayedTask( | 360 content::BrowserThread::PostDelayedTask( |
361 content::BrowserThread::UI, | 361 content::BrowserThread::UI, |
362 FROM_HERE, | 362 FROM_HERE, |
363 base::Bind(&DeviceSettingsService::Load, base::Unretained(this)), | 363 base::Bind(&DeviceSettingsService::Load, base::Unretained(this)), |
364 base::TimeDelta::FromMilliseconds(kLoadRetryDelayMs)); | 364 base::TimeDelta::FromMilliseconds(kLoadRetryDelayMs)); |
| 365 } else { |
| 366 // Once we've given up retrying, the validation error is not temporary |
| 367 // anymore. |
| 368 store_status_ = STORE_VALIDATION_ERROR; |
365 } | 369 } |
366 } | 370 } |
367 } | 371 } |
368 | 372 |
369 if (new_owner_key) { | 373 if (new_owner_key) { |
370 FOR_EACH_OBSERVER(Observer, observers_, OwnershipStatusChanged()); | 374 FOR_EACH_OBSERVER(Observer, observers_, OwnershipStatusChanged()); |
371 content::NotificationService::current()->Notify( | 375 content::NotificationService::current()->Notify( |
372 chrome::NOTIFICATION_OWNERSHIP_STATUS_CHANGED, | 376 chrome::NOTIFICATION_OWNERSHIP_STATUS_CHANGED, |
373 content::Source<DeviceSettingsService>(this), | 377 content::Source<DeviceSettingsService>(this), |
374 content::NotificationService::NoDetails()); | 378 content::NotificationService::NoDetails()); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 DeviceSettingsService::Initialize(); | 488 DeviceSettingsService::Initialize(); |
485 } | 489 } |
486 | 490 |
487 ScopedTestDeviceSettingsService::~ScopedTestDeviceSettingsService() { | 491 ScopedTestDeviceSettingsService::~ScopedTestDeviceSettingsService() { |
488 // Clean pending operations. | 492 // Clean pending operations. |
489 DeviceSettingsService::Get()->UnsetSessionManager(); | 493 DeviceSettingsService::Get()->UnsetSessionManager(); |
490 DeviceSettingsService::Shutdown(); | 494 DeviceSettingsService::Shutdown(); |
491 } | 495 } |
492 | 496 |
493 } // namespace chromeos | 497 } // namespace chromeos |
OLD | NEW |