| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "mojo/service_manager/service_manager.h" | 7 #include "mojo/service_manager/service_manager.h" |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return default_loader_.get(); | 178 return default_loader_.get(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void ServiceManager::OnServiceFactoryError(ServiceFactory* service_factory) { | 181 void ServiceManager::OnServiceFactoryError(ServiceFactory* service_factory) { |
| 182 // Called from ~ServiceFactory, so we do not need to call Destroy here. | 182 // Called from ~ServiceFactory, so we do not need to call Destroy here. |
| 183 const GURL url = service_factory->url(); | 183 const GURL url = service_factory->url(); |
| 184 URLToServiceFactoryMap::iterator it = url_to_service_factory_.find(url); | 184 URLToServiceFactoryMap::iterator it = url_to_service_factory_.find(url); |
| 185 DCHECK(it != url_to_service_factory_.end()); | 185 DCHECK(it != url_to_service_factory_.end()); |
| 186 delete it->second; | 186 delete it->second; |
| 187 url_to_service_factory_.erase(it); | 187 url_to_service_factory_.erase(it); |
| 188 GetLoaderForURL(url)->OnServiceError(this, url); | 188 ServiceLoader* loader = GetLoaderForURL(url); |
| 189 if (loader) |
| 190 loader->OnServiceError(this, url); |
| 189 } | 191 } |
| 190 | 192 |
| 191 } // namespace mojo | 193 } // namespace mojo |
| OLD | NEW |