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

Side by Side Diff: mojo/shell/keep_alive.h

Issue 491443005: Get rid of KeepAlive. Quit shell when all urls run directly by Context are closed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bring back ConnectToServiceViaNetwork Created 6 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_SHELL_KEEP_ALIVE_H_
6 #define MOJO_SHELL_KEEP_ALIVE_H_
7
8 #include "base/basictypes.h"
9
10 namespace mojo {
11 namespace shell {
12
13 class Context;
14 class KeepAlive;
15
16 class KeepAliveCounter {
17 public:
18 KeepAliveCounter() : count_(0) {
19 }
20 private:
21 friend class KeepAlive;
22 int count_;
23 };
24
25 // Instantiate this class to extend the lifetime of the thread associated
26 // with |context| (i.e., the shell's UI thread). Must only be used from
27 // the shell's UI thread.
28 class KeepAlive {
29 public:
30 explicit KeepAlive(Context* context);
31 ~KeepAlive();
32
33 private:
34 static void MaybeQuit(Context* context);
35
36 Context* context_;
37
38 DISALLOW_COPY_AND_ASSIGN(KeepAlive);
39 };
40
41 } // namespace shell
42 } // namespace mojo
43
44 #endif // MOJO_SHELL_KEEP_ALIVE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698