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

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

Issue 397733003: mojo: kill app_thread before unloading main app library and add tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/bind.h" 6 #include "base/bind.h"
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 "base/message_loop/message_loop.h"
10 #include "mojo/shell/child_process.h" 10 #include "mojo/shell/child_process.h"
(...skipping 15 matching lines...) Expand all
26 child_process->Main(); 26 child_process->Main();
27 } else { 27 } else {
28 gfx::GLSurface::InitializeOneOff(); 28 gfx::GLSurface::InitializeOneOff();
29 29
30 base::MessageLoop message_loop; 30 base::MessageLoop message_loop;
31 mojo::shell::Context shell_context; 31 mojo::shell::Context shell_context;
32 32
33 const base::CommandLine& command_line = 33 const base::CommandLine& command_line =
34 *base::CommandLine::ForCurrentProcess(); 34 *base::CommandLine::ForCurrentProcess();
35 if (command_line.HasSwitch(switches::kOrigin)) { 35 if (command_line.HasSwitch(switches::kOrigin)) {
36 shell_context.mojo_url_resolver()->set_origin( 36 shell_context.mojo_url_resolver()->SetOrigin(
37 command_line.GetSwitchValueASCII(switches::kOrigin)); 37 command_line.GetSwitchValueASCII(switches::kOrigin));
38 } 38 }
39 39
40 std::vector<GURL> app_urls; 40 std::vector<GURL> app_urls;
41 base::CommandLine::StringVector args = command_line.GetArgs(); 41 base::CommandLine::StringVector args = command_line.GetArgs();
42 for (base::CommandLine::StringVector::const_iterator it = args.begin(); 42 for (base::CommandLine::StringVector::const_iterator it = args.begin();
43 it != args.end(); 43 it != args.end();
44 ++it) 44 ++it)
45 app_urls.push_back(GURL(*it)); 45 app_urls.push_back(GURL(*it));
46 46
47 message_loop.PostTask(FROM_HERE, 47 message_loop.PostTask(FROM_HERE,
48 base::Bind(mojo::shell::Run, 48 base::Bind(mojo::shell::Run,
49 &shell_context, 49 &shell_context,
50 app_urls)); 50 app_urls));
51 51
52 message_loop.Run(); 52 message_loop.Run();
53 } 53 }
54 54
55 return 0; 55 return 0;
56 } 56 }
OLDNEW
« no previous file with comments | « mojo/mojo.gyp ('k') | mojo/shell/mojo_url_resolver.h » ('j') | mojo/shell/mojo_url_resolver.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698