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

Side by Side Diff: mojo/public/cpp/application/lib/mojo_main_standalone.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix network_service_loader 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 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/public/cpp/application/application_delegate.h" 5 #include "mojo/public/cpp/application/application_delegate.h"
6 #include "mojo/public/cpp/application/application_impl.h" 6 #include "mojo/public/cpp/application/application_impl.h"
7 #include "mojo/public/cpp/environment/environment.h" 7 #include "mojo/public/cpp/environment/environment.h"
8 #include "mojo/public/cpp/utility/run_loop.h" 8 #include "mojo/public/cpp/utility/run_loop.h"
9 9
10 extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain( 10 extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain(
11 MojoHandle shell_handle) { 11 MojoHandle shell_handle) {
12 mojo::Environment env; 12 mojo::Environment env;
13 mojo::RunLoop loop; 13 mojo::ApplicationDelegate* delegate = NULL;
14 mojo::ApplicationDelegate* delegate = mojo::ApplicationDelegate::Create();
15 { 14 {
16 mojo::ApplicationImpl app(delegate); 15 // We have to shut down the RunLoop before destroying the
17 app.BindShell(shell_handle); 16 // ApplicationDelegate.
18 loop.Run(); 17 mojo::RunLoop loop;
18 delegate = mojo::ApplicationDelegate::Create();
19 {
20 mojo::ApplicationImpl app(delegate);
21 app.BindShell(shell_handle);
22 loop.Run();
23 }
19 } 24 }
20 delete delegate; 25 delete delegate;
21 26
22 return MOJO_RESULT_OK; 27 return MOJO_RESULT_OK;
23 } 28 }
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/lib/mojo_main_chromium.cc ('k') | mojo/public/cpp/application/lib/service_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698