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

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

Issue 47433002: Cleanup mojo_shell and sample_app a bit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « mojo/shell/loader.cc ('k') | mojo/shell/sample_app.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/run.h" 5 #include "mojo/shell/run.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h"
9 #include "mojo/shell/app_container.h" 10 #include "mojo/shell/app_container.h"
10 #include "mojo/shell/switches.h" 11 #include "mojo/shell/switches.h"
11 #include "url/gurl.h" 12 #include "url/gurl.h"
12 13
13 namespace mojo { 14 namespace mojo {
14 namespace shell { 15 namespace shell {
15 16
16 void Run(Context* context) { 17 void Run(Context* context) {
17 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 18 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
18 if (!command_line.HasSwitch(switches::kApp)) { 19 if (!command_line.HasSwitch(switches::kApp)) {
19 LOG(ERROR) << "No app path specified."; 20 LOG(ERROR) << "No app path specified.";
21 base::MessageLoop::current()->Quit();
20 return; 22 return;
21 } 23 }
22 24
23 AppContainer* container = new AppContainer(context); 25 AppContainer* container = new AppContainer(context);
24 container->Load(GURL(command_line.GetSwitchValueASCII(switches::kApp))); 26 container->Load(GURL(command_line.GetSwitchValueASCII(switches::kApp)));
25 // TODO(abarth): Currently we leak |container|. 27 // TODO(abarth): Currently we leak |container|.
26 } 28 }
27 29
28 } // namespace shell 30 } // namespace shell
29 } // namespace mojo 31 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/loader.cc ('k') | mojo/shell/sample_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698