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.
5 #ifndef MOJO_SHELL_KEEP_ALIVE_H_
6 #define MOJO_SHELL_KEEP_ALIVE_H_
8 #include "base/basictypes.h"
16 class KeepAliveCounter
{
18 KeepAliveCounter() : count_(0) {
21 friend class KeepAlive
;
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.
30 explicit KeepAlive(Context
* context
);
34 static void MaybeQuit(Context
* context
);
38 DISALLOW_COPY_AND_ASSIGN(KeepAlive
);
44 #endif // MOJO_SHELL_KEEP_ALIVE_H_