| 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 "services/service_manager/service_manager.h" | 5 #include "services/service_manager/service_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 CreateServiceWithFactory(factory, target.name(), std::move(request)); | 933 CreateServiceWithFactory(factory, target.name(), std::move(request)); |
| 934 } else { | 934 } else { |
| 935 base::FilePath package_path; | 935 base::FilePath package_path; |
| 936 if (!service_overrides_ || !service_overrides_->GetExecutablePathOverride( | 936 if (!service_overrides_ || !service_overrides_->GetExecutablePathOverride( |
| 937 target.name(), &package_path)) { | 937 target.name(), &package_path)) { |
| 938 package_path = result->package_path; | 938 package_path = result->package_path; |
| 939 } | 939 } |
| 940 | 940 |
| 941 if (!instance->StartWithFilePath(package_path)) { | 941 if (!instance->StartWithFilePath(package_path)) { |
| 942 OnInstanceError(instance); | 942 OnInstanceError(instance); |
| 943 if (!params->connect_callback().is_null()) { |
| 944 params->connect_callback().Run( |
| 945 mojom::ConnectResult::INVALID_ARGUMENT, ""); |
| 946 } |
| 943 return; | 947 return; |
| 944 } | 948 } |
| 945 } | 949 } |
| 946 } | 950 } |
| 947 | 951 |
| 948 // Now that the instance has a Service, we can connect to it. | 952 // Now that the instance has a Service, we can connect to it. |
| 949 bool connected = instance->ConnectToService(¶ms); | 953 bool connected = instance->ConnectToService(¶ms); |
| 950 DCHECK(connected); | 954 DCHECK(connected); |
| 951 } | 955 } |
| 952 | 956 |
| 953 base::WeakPtr<ServiceManager> ServiceManager::GetWeakPtr() { | 957 base::WeakPtr<ServiceManager> ServiceManager::GetWeakPtr() { |
| 954 return weak_ptr_factory_.GetWeakPtr(); | 958 return weak_ptr_factory_.GetWeakPtr(); |
| 955 } | 959 } |
| 956 | 960 |
| 957 } // namespace service_manager | 961 } // namespace service_manager |
| OLD | NEW |