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 "mojo/shell/dynamic_service_loader.h" | 5 #include "mojo/shell/dynamic_service_loader.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "mojo/shell/context.h" | 9 #include "mojo/shell/context.h" |
10 #include "mojo/shell/keep_alive.h" | 10 #include "mojo/shell/keep_alive.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 | 99 |
100 void DynamicServiceLoader::LoadService(ServiceManager* manager, | 100 void DynamicServiceLoader::LoadService(ServiceManager* manager, |
101 const GURL& url, | 101 const GURL& url, |
102 ScopedShellHandle service_handle) { | 102 ScopedShellHandle service_handle) { |
103 DCHECK(url_to_load_context_.find(url) == url_to_load_context_.end()); | 103 DCHECK(url_to_load_context_.find(url) == url_to_load_context_.end()); |
104 url_to_load_context_[url] = new LoadContext( | 104 url_to_load_context_[url] = new LoadContext( |
105 this, url, service_handle.Pass(), runner_factory_->Create(context_)); | 105 this, url, service_handle.Pass(), runner_factory_->Create(context_)); |
106 } | 106 } |
107 | 107 |
| 108 void DynamicServiceLoader::OnServiceError(ServiceManager* manager, |
| 109 const GURL& url) { |
| 110 } |
| 111 |
108 void DynamicServiceLoader::AppCompleted(const GURL& url) { | 112 void DynamicServiceLoader::AppCompleted(const GURL& url) { |
109 DCHECK(context_->task_runners()->ui_runner()->BelongsToCurrentThread()); | 113 DCHECK(context_->task_runners()->ui_runner()->BelongsToCurrentThread()); |
110 DVLOG(2) << "App completed (url: " << url << ")"; | 114 DVLOG(2) << "App completed (url: " << url << ")"; |
111 | 115 |
112 LoadContextMap::iterator it = url_to_load_context_.find(url); | 116 LoadContextMap::iterator it = url_to_load_context_.find(url); |
113 DCHECK(it != url_to_load_context_.end()) << url; | 117 DCHECK(it != url_to_load_context_.end()) << url; |
114 | 118 |
115 LoadContext* doomed = it->second; | 119 LoadContext* doomed = it->second; |
116 url_to_load_context_.erase(it); | 120 url_to_load_context_.erase(it); |
117 | 121 |
118 delete doomed; | 122 delete doomed; |
119 } | 123 } |
120 | 124 |
121 } // namespace shell | 125 } // namespace shell |
122 } // namespace mojo | 126 } // namespace mojo |
OLD | NEW |