| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 void OnServiceStarted(const service_manager::Identity& identity, | 84 void OnServiceStarted(const service_manager::Identity& identity, |
| 85 uint32_t pid) override { | 85 uint32_t pid) override { |
| 86 for (auto& instance : instances_) { | 86 for (auto& instance : instances_) { |
| 87 if (instance.second.identity == identity) { | 87 if (instance.second.identity == identity) { |
| 88 instance.second.pid = pid; | 88 instance.second.pid = pid; |
| 89 break; | 89 break; |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 void OnServiceFailedToStart( |
| 94 const service_manager::Identity& identity) override { |
| 95 } |
| 93 void OnServiceStopped(const service_manager::Identity& identity) override { | 96 void OnServiceStopped(const service_manager::Identity& identity) override { |
| 94 for (auto it = instances_.begin(); it != instances_.end(); ++it) { | 97 for (auto it = instances_.begin(); it != instances_.end(); ++it) { |
| 95 if (it->second.identity == identity) { | 98 if (it->second.identity == identity) { |
| 96 instances_.erase(it); | 99 instances_.erase(it); |
| 97 break; | 100 break; |
| 98 } | 101 } |
| 99 } | 102 } |
| 100 TryToQuitDestructionLoop(); | 103 TryToQuitDestructionLoop(); |
| 101 } | 104 } |
| 102 | 105 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 parent->Quit(); | 447 parent->Quit(); |
| 445 | 448 |
| 446 // Quitting the parent should cascade-quit the child. | 449 // Quitting the parent should cascade-quit the child. |
| 447 WaitForInstanceDestruction(); | 450 WaitForInstanceDestruction(); |
| 448 EXPECT_EQ(0u, instances()->GetNewInstanceCount()); | 451 EXPECT_EQ(0u, instances()->GetNewInstanceCount()); |
| 449 EXPECT_FALSE(instances()->HasInstanceForName(kTestParentName)); | 452 EXPECT_FALSE(instances()->HasInstanceForName(kTestParentName)); |
| 450 EXPECT_FALSE(instances()->HasInstanceForName(kTestAppName)); | 453 EXPECT_FALSE(instances()->HasInstanceForName(kTestAppName)); |
| 451 } | 454 } |
| 452 | 455 |
| 453 } // namespace service_manager | 456 } // namespace service_manager |
| OLD | NEW |