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

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

Issue 1318103003: mandoline: Obey --no-sandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix collision with content. Created 5 years, 3 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 | mojo/shell/switches.h » ('j') | no next file with comments »
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/application_manager.h" 5 #include "mojo/shell/application_manager.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/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 if (url_to_native_options_.find(base_resolved_url) != 375 if (url_to_native_options_.find(base_resolved_url) !=
376 url_to_native_options_.end()) { 376 url_to_native_options_.end()) {
377 DVLOG(2) << "Applying stored native options to resolved URL " 377 DVLOG(2) << "Applying stored native options to resolved URL "
378 << fetcher->GetURL(); 378 << fetcher->GetURL();
379 options = url_to_native_options_[base_resolved_url]; 379 options = url_to_native_options_[base_resolved_url];
380 } 380 }
381 381
382 // TODO(erg): Have a better way of switching the sandbox on. For now, switch 382 // TODO(erg): Have a better way of switching the sandbox on. For now, switch
383 // it on hard coded when we're using some of the sandboxable core services. 383 // it on hard coded when we're using some of the sandboxable core services.
384 bool start_sandboxed = false; 384 bool start_sandboxed = false;
385 if (app_url == GURL("mojo://core_services/") && qualifier == "Core") 385 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
386 start_sandboxed = true; 386 switches::kMojoNoSandbox)) {
387 else if (app_url == GURL("mojo://html_viewer/")) 387 if (app_url == GURL("mojo://core_services/") && qualifier == "Core")
388 start_sandboxed = true; 388 start_sandboxed = true;
389 else if (app_url == GURL("mojo://html_viewer/"))
390 start_sandboxed = true;
391 }
389 392
390 fetcher->AsPath(blocking_pool_, 393 fetcher->AsPath(blocking_pool_,
391 base::Bind(&ApplicationManager::RunNativeApplication, 394 base::Bind(&ApplicationManager::RunNativeApplication,
392 weak_ptr_factory_.GetWeakPtr(), 395 weak_ptr_factory_.GetWeakPtr(),
393 base::Passed(request.Pass()), start_sandboxed, 396 base::Passed(request.Pass()), start_sandboxed,
394 options, cleanup, base::Passed(fetcher.Pass()))); 397 options, cleanup, base::Passed(fetcher.Pass())));
395 } 398 }
396 399
397 void ApplicationManager::RunNativeApplication( 400 void ApplicationManager::RunNativeApplication(
398 InterfaceRequest<Application> application_request, 401 InterfaceRequest<Application> application_request,
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 ConnectToApplication(nullptr, request.Pass(), std::string(), GURL(), 547 ConnectToApplication(nullptr, request.Pass(), std::string(), GURL(),
545 GetProxy(&services), nullptr, 548 GetProxy(&services), nullptr,
546 GetPermissiveCapabilityFilter(), base::Closure()); 549 GetPermissiveCapabilityFilter(), base::Closure());
547 MessagePipe pipe; 550 MessagePipe pipe;
548 services->ConnectToService(interface_name, pipe.handle1.Pass()); 551 services->ConnectToService(interface_name, pipe.handle1.Pass());
549 return pipe.handle0.Pass(); 552 return pipe.handle0.Pass();
550 } 553 }
551 554
552 } // namespace shell 555 } // namespace shell
553 } // namespace mojo 556 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/shell/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698