| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/arc/storage_manager/arc_storage_manager.h" | 5 #include "components/arc/storage_manager/arc_storage_manager.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "components/arc/arc_bridge_service.h" | 11 #include "components/arc/arc_bridge_service.h" |
| 12 | 12 |
| 13 namespace arc { | 13 namespace arc { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 const int kMinInstanceVersion = 1; // See storage_manager.mojom. | 17 const int kMinInstanceVersion = 0; // See storage_manager.mojom. |
| 18 | 18 |
| 19 // This class is owned by ArcServiceManager so that it is safe to use this raw | 19 // This class is owned by ArcServiceManager so that it is safe to use this raw |
| 20 // pointer as the singleton reference. | 20 // pointer as the singleton reference. |
| 21 ArcStorageManager* g_arc_storage_manager = nullptr; | 21 ArcStorageManager* g_arc_storage_manager = nullptr; |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 ArcStorageManager::ArcStorageManager(ArcBridgeService *bridge_service) | 25 ArcStorageManager::ArcStorageManager(ArcBridgeService *bridge_service) |
| 26 : ArcService(bridge_service) { | 26 : ArcService(bridge_service) { |
| 27 DCHECK(!g_arc_storage_manager); | 27 DCHECK(!g_arc_storage_manager); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 auto storage_manager_version = bridge_service->storage_manager_version(); | 72 auto storage_manager_version = bridge_service->storage_manager_version(); |
| 73 if (storage_manager_version < kMinInstanceVersion) { | 73 if (storage_manager_version < kMinInstanceVersion) { |
| 74 DLOG(ERROR) << "ARC storage manager instance (version " | 74 DLOG(ERROR) << "ARC storage manager instance (version " |
| 75 << storage_manager_version << ") is too old."; | 75 << storage_manager_version << ") is too old."; |
| 76 return nullptr; | 76 return nullptr; |
| 77 } | 77 } |
| 78 return storage_manager_instance; | 78 return storage_manager_instance; |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace arc | 81 } // namespace arc |
| OLD | NEW |