Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3476)

Unified Diff: services/service_manager/service_manager.cc

Issue 2706383002: DO NOT SUBMIT: Show silent service manager failure (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/service_manager/public/cpp/lib/service_context.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/service_manager/service_manager.cc
diff --git a/services/service_manager/service_manager.cc b/services/service_manager/service_manager.cc
index 99b9869ee5b99b844139621efe4698041b13fee5..9bfb78c51e0b914f6073249cdb59479e9cd507a5 100644
--- a/services/service_manager/service_manager.cc
+++ b/services/service_manager/service_manager.cc
@@ -212,24 +212,32 @@ class ServiceManager::Instance
return false;
}
+ LOG(INFO) << "Call callback: " << identity().name();
params->bind_interface_callback().Run(mojom::ConnectResult::SUCCEEDED,
identity_.user_id());
pending_service_connections_++;
+ LOG(INFO) << "iname: " << params->interface_name();
+ auto interface_pipe = params->TakeInterfaceRequestPipe();
+ LOG(INFO) << "ServiceManager::Instance::BindInterface: "
+ << interface_pipe.get().value();
service_->OnBindInterface(
ServiceInfo(params->source(), source_specs),
params->interface_name(),
- params->TakeInterfaceRequestPipe(),
+ std::move(interface_pipe),
base::Bind(&Instance::OnConnectComplete, base::Unretained(this)));
return true;
}
void OnConnectComplete() {
+ LOG(INFO) << "OnConnectComplete: " << identity().name();
DCHECK_GT(pending_service_connections_, 0);
pending_service_connections_--;
}
void StartWithService(mojom::ServicePtr service) {
+ LOG(INFO) << "ServiceManagerInstance::StartWithService: "
+ << identity().name();
CHECK(!service_);
state_ = State::STARTING;
service_ = std::move(service);
@@ -348,6 +356,10 @@ class ServiceManager::Instance
const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe,
const BindInterfaceCallback& callback) override {
+ LOG_IF(INFO, interface_name == "prefs::mojom::PrefStoreRegistry")
+ << "ServiceManager::Instance::BindInterface";
+ LOG(INFO) << "ServiceManager::BindInterface: "
+ << interface_pipe.get().value();
Identity target = in_target;
mojom::ConnectResult result =
ValidateConnectParams(&target, nullptr, nullptr);
@@ -499,6 +511,7 @@ class ServiceManager::Instance
void OnServiceLost(
base::WeakPtr<service_manager::ServiceManager> service_manager) {
+ LOG(INFO) << "ServiceManagerInstance::OnServiceLost: " << identity().name();
service_.reset();
OnConnectionLost(service_manager);
}
@@ -751,6 +764,8 @@ void ServiceManager::OnInstanceError(Instance* instance) {
}
void ServiceManager::OnInstanceUnreachable(Instance* instance) {
+ LOG(INFO) << "ServiceManager::OnInstanceUnreachable: "
+ << instance->identity().name();
// If an Instance becomes unreachable, new connection requests for this
// identity will elicit a new Instance instantiation. The unreachable instance
// remains alive.
@@ -767,6 +782,8 @@ void ServiceManager::OnInstanceStopped(const Identity& identity) {
void ServiceManager::Connect(std::unique_ptr<ConnectParams> params,
base::WeakPtr<Instance> source_instance) {
+ LOG_IF(INFO, params->target().name() == "preferences")
+ << "ServiceManager::Connect";
TRACE_EVENT_INSTANT1("service_manager", "ServiceManager::Connect",
TRACE_EVENT_SCOPE_THREAD, "original_name",
params->target().name());
@@ -903,6 +920,8 @@ void ServiceManager::AddListener(mojom::ServiceManagerListenerPtr listener) {
void ServiceManager::CreateServiceWithFactory(const Identity& service_factory,
const std::string& name,
mojom::ServiceRequest request) {
+ LOG_IF(INFO, name == "preferences")
+ << "ServiceManager::CreateServiceWithFactory";
mojom::ServiceFactory* factory = GetServiceFactory(service_factory);
factory->CreateService(std::move(request), name);
}
@@ -926,6 +945,7 @@ mojom::ServiceFactory* ServiceManager::GetServiceFactory(
}
void ServiceManager::OnServiceFactoryLost(const Identity& which) {
+ LOG(INFO) << "ServiceManager::OnServiceFactoryLost";
// Remove the mapping.
auto it = service_factories_.find(which);
DCHECK(it != service_factories_.end());
@@ -937,6 +957,8 @@ void ServiceManager::OnGotResolvedName(std::unique_ptr<ConnectParams> params,
base::WeakPtr<Instance> source_instance,
mojom::ResolveResultPtr result,
mojom::ResolveResultPtr parent) {
+ LOG_IF(INFO, params->target().name() == "preferences")
+ << "ServiceManager::OnGotResolvedName";
// If this request was originated by a specific Instance and that Instance is
// no longer around, we ignore this response.
if (has_source_instance && !source_instance)
@@ -1016,6 +1038,8 @@ void ServiceManager::OnGotResolvedName(std::unique_ptr<ConnectParams> params,
return;
}
+ LOG_IF(INFO, params->target().name() == "preferences")
+ << "parent: " << bool(parent);
if (parent) {
// This service is provided by another service via a ServiceFactory.
std::string target_user_id = target.user_id();
« no previous file with comments | « services/service_manager/public/cpp/lib/service_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698