summaryrefslogtreecommitdiffstats
path: root/chrome/browser/apps/scoped_keep_alive.cc
blob: 586a47448a0eff3f57996632c90ddeba5f20a39a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/apps/scoped_keep_alive.h"

#include "chrome/browser/browser_process.h"
#include "chrome/browser/lifetime/application_lifetime.h"

ScopedKeepAlive::ScopedKeepAlive() {
  // Allow ScopedKeepAlive to be used in unit tests.
  if (g_browser_process)
    chrome::IncrementKeepAliveCount();
}

ScopedKeepAlive::~ScopedKeepAlive() {
  if (g_browser_process)
    chrome::DecrementKeepAliveCount();
}