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 #include "extensions/browser/mojo/keep_alive_impl.h"
7 #include "extensions/browser/process_manager.h"
12 void KeepAliveImpl::Create(content::BrowserContext
* context
,
13 const Extension
* extension
,
14 mojo::InterfaceRequest
<KeepAlive
> request
) {
15 new KeepAliveImpl(context
, extension
, request
.Pass());
18 KeepAliveImpl::KeepAliveImpl(content::BrowserContext
* context
,
19 const Extension
* extension
,
20 mojo::InterfaceRequest
<KeepAlive
> request
)
21 : context_(context
), extension_(extension
), binding_(this, request
.Pass()) {
22 ProcessManager::Get(context_
)->IncrementLazyKeepaliveCount(extension_
);
25 KeepAliveImpl::~KeepAliveImpl() {
26 ProcessManager::Get(context_
)->DecrementLazyKeepaliveCount(extension_
);
29 } // namespace extensions