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

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

Issue 27943002: Teach mojo_shell how to load http URLs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix lifetime Created 7 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 | Annotate | Revision Log
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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "mojo/shell/app_container.h" 10 #include "mojo/shell/app_container.h"
11 #include "mojo/shell/storage.h"
11 #include "mojo/shell/switches.h" 12 #include "mojo/shell/switches.h"
13 #include "mojo/shell/task_runners.h"
12 #include "mojo/system/core_impl.h" 14 #include "mojo/system/core_impl.h"
13 15
14 int main(int argc, char** argv) { 16 int main(int argc, char** argv) {
15 base::AtExitManager at_exit; 17 base::AtExitManager at_exit;
16 CommandLine::Init(argc, argv); 18 CommandLine::Init(argc, argv);
17 19
18 mojo::system::CoreImpl::Init(); 20 mojo::system::CoreImpl::Init();
19 21
20 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); 22 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI);
21 23
24 // TODO(abarth): Group these objects into a "context" object.
25 mojo::shell::TaskRunners task_runners(message_loop.message_loop_proxy());
26 mojo::shell::Storage storage;
27
22 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 28 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
23 if (!command_line.HasSwitch(switches::kApp)) { 29 if (!command_line.HasSwitch(switches::kApp)) {
24 LOG(ERROR) << "No app path specified."; 30 LOG(ERROR) << "No app path specified.";
25 return 0; 31 return 0;
26 } 32 }
27 33
28 scoped_ptr<mojo::shell::AppContainer> container( 34 scoped_ptr<mojo::shell::AppContainer> container(
29 new mojo::shell::AppContainer); 35 new mojo::shell::AppContainer);
30 container->LaunchApp(command_line.GetSwitchValuePath(switches::kApp)); 36 container->LaunchApp(command_line.GetSwitchValuePath(switches::kApp));
31 message_loop.Run(); 37 message_loop.Run();
32 return 0; 38 return 0;
33 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698