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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 LoaderComplete(); | 166 LoaderComplete(); |
| 167 return; | 167 return; |
| 168 } | 168 } |
| 169 | 169 |
| 170 MimeTypeToURLMap::iterator iter = | 170 MimeTypeToURLMap::iterator iter = |
| 171 mime_type_to_url_->find(response->mime_type); | 171 mime_type_to_url_->find(response->mime_type); |
| 172 if (iter != mime_type_to_url_->end()) { | 172 if (iter != mime_type_to_url_->end()) { |
| 173 load_callbacks_->LoadWithContentHandler(iter->second, response.Pass()); | 173 load_callbacks_->LoadWithContentHandler(iter->second, response.Pass()); |
| 174 return; | 174 return; |
| 175 } | 175 } |
| 176 LOG(ERROR) << "Failed to find content handler for " << response->mime_type | |
| 177 << " from " << response->url << std::endl | |
| 178 << "INSECURELY LOADING AS EXECUTABLE CODE INSTEAD" << std::endl; | |
|
Aaron Boodman
2014/10/31 16:14:48
Did you mean this as just temporary until sandboxi
| |
| 176 | 179 |
| 177 base::CreateTemporaryFile(&file_); | 180 base::CreateTemporaryFile(&file_); |
| 178 common::CopyToFile( | 181 common::CopyToFile( |
| 179 response->body.Pass(), | 182 response->body.Pass(), |
| 180 file_, | 183 file_, |
| 181 context_->task_runners()->blocking_pool(), | 184 context_->task_runners()->blocking_pool(), |
| 182 base::Bind( | 185 base::Bind( |
| 183 &NetworkLoader::RunLibrary, weak_ptr_factory_.GetWeakPtr(), file_)); | 186 &NetworkLoader::RunLibrary, weak_ptr_factory_.GetWeakPtr(), file_)); |
| 184 } | 187 } |
| 185 | 188 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 // TODO(darin): What should we do about service errors? This implies that | 253 // TODO(darin): What should we do about service errors? This implies that |
| 251 // the app closed its handle to the service manager. Maybe we don't care? | 254 // the app closed its handle to the service manager. Maybe we don't care? |
| 252 } | 255 } |
| 253 | 256 |
| 254 void DynamicApplicationLoader::LoaderComplete(Loader* loader) { | 257 void DynamicApplicationLoader::LoaderComplete(Loader* loader) { |
| 255 loaders_.erase(std::find(loaders_.begin(), loaders_.end(), loader)); | 258 loaders_.erase(std::find(loaders_.begin(), loaders_.end(), loader)); |
| 256 } | 259 } |
| 257 | 260 |
| 258 } // namespace shell | 261 } // namespace shell |
| 259 } // namespace mojo | 262 } // namespace mojo |
| OLD | NEW |