summaryrefslogtreecommitdiffstats
path: root/extensions/browser/mojo
diff options
context:
space:
mode:
authorreillyg <reillyg@chromium.org>2014-10-28 08:30:23 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-28 15:30:47 +0000
commit0ea3fa90a36f091c943e286ade39b0252e5d34d7 (patch)
tree46bbe1b91e168c2d172699f5a1a52dd8634f33be /extensions/browser/mojo
parentecfca4638d05a0f4b5839f52a00ed4ebc4d3f756 (diff)
downloadchromium_src-0ea3fa90a36f091c943e286ade39b0252e5d34d7.zip
chromium_src-0ea3fa90a36f091c943e286ade39b0252e5d34d7.tar.gz
chromium_src-0ea3fa90a36f091c943e286ade39b0252e5d34d7.tar.bz2
Extract ProcessManager from ExtensionSystem.
This change removes ProcessManager's //chrome dependency because while ProcessManager and ExtensionSystem are in //extensions the ExtensionSystemFactory is in //chrome. This allows a service in //extensions to declare a dependency on the ProcessManager's factory directly. Most of this patch is changing, extensions::ExtensionSystem::Get(profile_)->process_manager() to, extensions::ProcessManager::Get(profile_). BUG= TBR=erikwright@chromium.org Review URL: https://codereview.chromium.org/671763002 Cr-Commit-Position: refs/heads/master@{#301636}
Diffstat (limited to 'extensions/browser/mojo')
-rw-r--r--extensions/browser/mojo/keep_alive_impl.cc11
-rw-r--r--extensions/browser/mojo/keep_alive_impl_unittest.cc21
2 files changed, 4 insertions, 28 deletions
diff --git a/extensions/browser/mojo/keep_alive_impl.cc b/extensions/browser/mojo/keep_alive_impl.cc
index 4073ce1..04e4966 100644
--- a/extensions/browser/mojo/keep_alive_impl.cc
+++ b/extensions/browser/mojo/keep_alive_impl.cc
@@ -4,7 +4,6 @@
#include "extensions/browser/mojo/keep_alive_impl.h"
-#include "extensions/browser/extension_system.h"
#include "extensions/browser/process_manager.h"
namespace extensions {
@@ -19,17 +18,11 @@ void KeepAliveImpl::Create(content::BrowserContext* context,
KeepAliveImpl::KeepAliveImpl(content::BrowserContext* context,
const Extension* extension)
: context_(context), extension_(extension) {
- ExtensionSystem* system = ExtensionSystem::Get(context_);
- if (!system)
- return;
- system->process_manager()->IncrementLazyKeepaliveCount(extension_);
+ ProcessManager::Get(context_)->IncrementLazyKeepaliveCount(extension_);
}
KeepAliveImpl::~KeepAliveImpl() {
- ExtensionSystem* system = ExtensionSystem::Get(context_);
- if (!system)
- return;
- system->process_manager()->DecrementLazyKeepaliveCount(extension_);
+ ProcessManager::Get(context_)->DecrementLazyKeepaliveCount(extension_);
}
} // namespace extensions
diff --git a/extensions/browser/mojo/keep_alive_impl_unittest.cc b/extensions/browser/mojo/keep_alive_impl_unittest.cc
index eea8f83..b9ca700 100644
--- a/extensions/browser/mojo/keep_alive_impl_unittest.cc
+++ b/extensions/browser/mojo/keep_alive_impl_unittest.cc
@@ -17,22 +17,6 @@
namespace extensions {
-namespace {
-
-class TestExtensionSystem : public MockExtensionSystem {
- public:
- explicit TestExtensionSystem(content::BrowserContext* context)
- : MockExtensionSystem(context),
- process_manager_(ProcessManager::Create(context)) {}
-
- ProcessManager* process_manager() override { return process_manager_.get(); }
-
- private:
- scoped_ptr<ProcessManager> process_manager_;
-};
-
-} // namespace
-
class KeepAliveTest : public ExtensionsTest {
public:
KeepAliveTest()
@@ -81,14 +65,13 @@ class KeepAliveTest : public ExtensionsTest {
const Extension* extension() { return extension_.get(); }
int GetKeepAliveCount() {
- return ExtensionSystem::Get(browser_context())
- ->process_manager()
+ return ProcessManager::Get(browser_context())
->GetLazyKeepaliveCount(extension());
}
private:
scoped_ptr<base::MessageLoop> message_loop_;
- MockExtensionSystemFactory<TestExtensionSystem> extension_system_factory_;
+ MockExtensionSystemFactory<MockExtensionSystem> extension_system_factory_;
scoped_ptr<content::NotificationService> notification_service_;
scoped_refptr<const Extension> extension_;
scoped_ptr<TestExtensionsBrowserClient> browser_client_;