Chromium Code Reviews| 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_application_loader.h" | 5 #include "mojo/shell/dynamic_application_loader.h" |
| 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/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 base::Bind(&DynamicApplicationLoader::LoaderComplete, | 204 base::Bind(&DynamicApplicationLoader::LoaderComplete, |
| 205 base::Unretained(this))) { | 205 base::Unretained(this))) { |
| 206 } | 206 } |
| 207 | 207 |
| 208 DynamicApplicationLoader::~DynamicApplicationLoader() { | 208 DynamicApplicationLoader::~DynamicApplicationLoader() { |
| 209 } | 209 } |
| 210 | 210 |
| 211 void DynamicApplicationLoader::RegisterContentHandler( | 211 void DynamicApplicationLoader::RegisterContentHandler( |
| 212 const std::string& mime_type, | 212 const std::string& mime_type, |
| 213 const GURL& content_handler_url) { | 213 const GURL& content_handler_url) { |
| 214 DCHECK(content_handler_url.possibly_invalid_spec().size() > 0) | |
|
Aaron Boodman
2014/11/20 21:53:59
DCHECK(content_handler_url.is_valid())
azani
2014/11/20 22:10:03
Done.
| |
| 215 << "Content handler URL is invalid for mime type " << mime_type; | |
| 214 mime_type_to_url_[mime_type] = content_handler_url; | 216 mime_type_to_url_[mime_type] = content_handler_url; |
| 215 } | 217 } |
| 216 | 218 |
| 217 void DynamicApplicationLoader::Load( | 219 void DynamicApplicationLoader::Load( |
| 218 ApplicationManager* manager, | 220 ApplicationManager* manager, |
| 219 const GURL& url, | 221 const GURL& url, |
| 220 scoped_refptr<LoadCallbacks> load_callbacks) { | 222 scoped_refptr<LoadCallbacks> load_callbacks) { |
| 221 GURL resolved_url; | 223 GURL resolved_url; |
| 222 if (url.SchemeIs("mojo")) { | 224 if (url.SchemeIs("mojo")) { |
| 223 resolved_url = context_->mojo_url_resolver()->Resolve(url); | 225 resolved_url = context_->mojo_url_resolver()->Resolve(url); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 253 // TODO(darin): What should we do about service errors? This implies that | 255 // TODO(darin): What should we do about service errors? This implies that |
| 254 // the app closed its handle to the service manager. Maybe we don't care? | 256 // the app closed its handle to the service manager. Maybe we don't care? |
| 255 } | 257 } |
| 256 | 258 |
| 257 void DynamicApplicationLoader::LoaderComplete(Loader* loader) { | 259 void DynamicApplicationLoader::LoaderComplete(Loader* loader) { |
| 258 loaders_.erase(std::find(loaders_.begin(), loaders_.end(), loader)); | 260 loaders_.erase(std::find(loaders_.begin(), loaders_.end(), loader)); |
| 259 } | 261 } |
| 260 | 262 |
| 261 } // namespace shell | 263 } // namespace shell |
| 262 } // namespace mojo | 264 } // namespace mojo |
| OLD | NEW |