| OLD | NEW |
| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "extensions/browser/extension_registry.h" | 10 #include "extensions/browser/extension_registry.h" |
| 11 #include "extensions/browser/process_manager.h" | 11 #include "extensions/browser/process_manager.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 // static | 15 // static |
| 16 void KeepAliveImpl::Create(content::BrowserContext* context, | 16 void KeepAliveImpl::Create(content::BrowserContext* context, |
| 17 const Extension* extension, | 17 const Extension* extension, |
| 18 const service_manager::BindSourceInfo& source_info, |
| 18 KeepAliveRequest request) { | 19 KeepAliveRequest request) { |
| 19 // Owns itself. | 20 // Owns itself. |
| 20 new KeepAliveImpl(context, extension, std::move(request)); | 21 new KeepAliveImpl(context, extension, std::move(request)); |
| 21 } | 22 } |
| 22 | 23 |
| 23 KeepAliveImpl::KeepAliveImpl(content::BrowserContext* context, | 24 KeepAliveImpl::KeepAliveImpl(content::BrowserContext* context, |
| 24 const Extension* extension, | 25 const Extension* extension, |
| 25 KeepAliveRequest request) | 26 KeepAliveRequest request) |
| 26 : context_(context), | 27 : context_(context), |
| 27 extension_(extension), | 28 extension_(extension), |
| (...skipping 18 matching lines...) Expand all Loading... |
| 46 void KeepAliveImpl::OnShutdown(ExtensionRegistry* registry) { | 47 void KeepAliveImpl::OnShutdown(ExtensionRegistry* registry) { |
| 47 delete this; | 48 delete this; |
| 48 } | 49 } |
| 49 | 50 |
| 50 void KeepAliveImpl::OnDisconnected() { | 51 void KeepAliveImpl::OnDisconnected() { |
| 51 ProcessManager::Get(context_)->DecrementLazyKeepaliveCount(extension_); | 52 ProcessManager::Get(context_)->DecrementLazyKeepaliveCount(extension_); |
| 52 delete this; | 53 delete this; |
| 53 } | 54 } |
| 54 | 55 |
| 55 } // namespace extensions | 56 } // namespace extensions |
| OLD | NEW |