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

Side by Side Diff: mojo/environment/scoped_chromium_init.h

Issue 2011383002: Get rid of {Run,Terminate}MainApplication(), and more ApplicationDelegate conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 4 years, 6 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 | « mojo/environment/BUILD.gn ('k') | mojo/environment/scoped_chromium_init.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_ENVIRONMENT_SCOPED_CHROMIUM_INIT_H_
6 #define MOJO_ENVIRONMENT_SCOPED_CHROMIUM_INIT_H_
7
8 #include "base/at_exit.h"
9 #include "base/macros.h"
10
11 namespace mojo {
12
13 // Using code from //base typically requires that a number of things be
14 // initialized/present. In particular the global |base::CommandLine| singleton
15 // should be initialized and an |AtExitManager| should be present.
16 //
17 // This class is a simple helper that does these things (and tears down the
18 // |AtExitManager| on destruction). Typically, it should be used in |MojoMain()|
19 // as follows:
20 //
21 // MojoResult MojoMain(MojoHandle application_request) {
22 // mojo::ScopedBaseInit init;
23 // ...
24 // }
25 //
26 // TODO(vtl): Maybe this should be called |ScopedBaseInit|, but for now I'm
27 // being consistent with everything else that refers to things that use //base
28 // as "chromium".
29 class ScopedChromiumInit {
30 public:
31 ScopedChromiumInit();
32 ~ScopedChromiumInit();
33
34 private:
35 base::AtExitManager at_exit_manager_;
36
37 DISALLOW_COPY_AND_ASSIGN(ScopedChromiumInit);
38 };
39
40 } // namespace mojo
41
42 #endif // MOJO_ENVIRONMENT_SCOPED_CHROMIUM_INIT_H_
OLDNEW
« no previous file with comments | « mojo/environment/BUILD.gn ('k') | mojo/environment/scoped_chromium_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698