Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / app_list / keep_alive_service_impl.cc
1 // Copyright 2013 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 #include "chrome/browser/ui/app_list/keep_alive_service_impl.h"
6
7 #include "chrome/browser/lifetime/application_lifetime.h"
8
9 ScopedKeepAlive::ScopedKeepAlive() { chrome::IncrementKeepAliveCount(); }
10
11 ScopedKeepAlive::~ScopedKeepAlive() { chrome::DecrementKeepAliveCount(); }
12
13 KeepAliveServiceImpl::KeepAliveServiceImpl() {
14 }
15
16 KeepAliveServiceImpl::~KeepAliveServiceImpl() {
17 }
18
19 void KeepAliveServiceImpl::EnsureKeepAlive() {
20   if (!keep_alive_)
21     keep_alive_.reset(new ScopedKeepAlive());
22 }
23
24 void KeepAliveServiceImpl::FreeKeepAlive() {
25   if (keep_alive_)
26     keep_alive_.reset();
27 }