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

Side by Side Diff: extensions/browser/mojo/keep_alive_impl.cc

Issue 671763002: Extract ProcessManager from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/mojo/keep_alive_impl.h" 5 #include "extensions/browser/mojo/keep_alive_impl.h"
6 6
7 #include "extensions/browser/extension_system.h"
8 #include "extensions/browser/process_manager.h" 7 #include "extensions/browser/process_manager.h"
9 8
10 namespace extensions { 9 namespace extensions {
11 10
12 // static 11 // static
13 void KeepAliveImpl::Create(content::BrowserContext* context, 12 void KeepAliveImpl::Create(content::BrowserContext* context,
14 const Extension* extension, 13 const Extension* extension,
15 mojo::InterfaceRequest<KeepAlive> request) { 14 mojo::InterfaceRequest<KeepAlive> request) {
16 mojo::BindToRequest(new KeepAliveImpl(context, extension), &request); 15 mojo::BindToRequest(new KeepAliveImpl(context, extension), &request);
17 } 16 }
18 17
19 KeepAliveImpl::KeepAliveImpl(content::BrowserContext* context, 18 KeepAliveImpl::KeepAliveImpl(content::BrowserContext* context,
20 const Extension* extension) 19 const Extension* extension)
21 : context_(context), extension_(extension) { 20 : context_(context), extension_(extension) {
22 ExtensionSystem* system = ExtensionSystem::Get(context_); 21 ProcessManager::Get(context_)->IncrementLazyKeepaliveCount(extension_);
23 if (!system)
24 return;
25 system->process_manager()->IncrementLazyKeepaliveCount(extension_);
26 } 22 }
27 23
28 KeepAliveImpl::~KeepAliveImpl() { 24 KeepAliveImpl::~KeepAliveImpl() {
29 ExtensionSystem* system = ExtensionSystem::Get(context_); 25 ProcessManager::Get(context_)->DecrementLazyKeepaliveCount(extension_);
30 if (!system)
31 return;
32 system->process_manager()->DecrementLazyKeepaliveCount(extension_);
33 } 26 }
34 27
35 } // namespace extensions 28 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/mock_extension_system.cc ('k') | extensions/browser/mojo/keep_alive_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698