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

Side by Side Diff: mojo/shell/dynamic_application_loader.cc

Issue 672363002: Make skydb load examples/home.sky by default. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/examples/home.sky » ('j') | sky/examples/home.sky » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | sky/examples/home.sky » ('j') | sky/examples/home.sky » ('J')

Powered by Google App Engine
This is Rietveld 408576698