summaryrefslogtreecommitdiffstats
path: root/extensions/browser/mojo
diff options
context:
space:
mode:
authorsammc <sammc@chromium.org>2015-05-19 21:55:37 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-20 04:55:43 +0000
commitceff908a1afba3e54c7d6ec133654e5afb4007a6 (patch)
tree6d76e7ea5185a7838f868e39b2de57a89268b573 /extensions/browser/mojo
parenta6faceeb923420b8f8ec83029ecda0fffac5438f (diff)
downloadchromium_src-ceff908a1afba3e54c7d6ec133654e5afb4007a6.zip
chromium_src-ceff908a1afba3e54c7d6ec133654e5afb4007a6.tar.gz
chromium_src-ceff908a1afba3e54c7d6ec133654e5afb4007a6.tar.bz2
Remove mojo::InterfaceImpl from extensions.
BUG=489751 Review URL: https://codereview.chromium.org/1148703002 Cr-Commit-Position: refs/heads/master@{#330699}
Diffstat (limited to 'extensions/browser/mojo')
-rw-r--r--extensions/browser/mojo/keep_alive_impl.cc7
-rw-r--r--extensions/browser/mojo/keep_alive_impl.h8
2 files changed, 10 insertions, 5 deletions
diff --git a/extensions/browser/mojo/keep_alive_impl.cc b/extensions/browser/mojo/keep_alive_impl.cc
index 04e4966..9b80598 100644
--- a/extensions/browser/mojo/keep_alive_impl.cc
+++ b/extensions/browser/mojo/keep_alive_impl.cc
@@ -12,12 +12,13 @@ namespace extensions {
void KeepAliveImpl::Create(content::BrowserContext* context,
const Extension* extension,
mojo::InterfaceRequest<KeepAlive> request) {
- mojo::BindToRequest(new KeepAliveImpl(context, extension), &request);
+ new KeepAliveImpl(context, extension, request.Pass());
}
KeepAliveImpl::KeepAliveImpl(content::BrowserContext* context,
- const Extension* extension)
- : context_(context), extension_(extension) {
+ const Extension* extension,
+ mojo::InterfaceRequest<KeepAlive> request)
+ : context_(context), extension_(extension), binding_(this, request.Pass()) {
ProcessManager::Get(context_)->IncrementLazyKeepaliveCount(extension_);
}
diff --git a/extensions/browser/mojo/keep_alive_impl.h b/extensions/browser/mojo/keep_alive_impl.h
index 09473e2..58108b8 100644
--- a/extensions/browser/mojo/keep_alive_impl.h
+++ b/extensions/browser/mojo/keep_alive_impl.h
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "extensions/common/mojo/keep_alive.mojom.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
namespace content {
class BrowserContext;
@@ -18,7 +19,7 @@ class Extension;
// An RAII mojo service implementation for extension keep alives. This adds a
// keep alive on construction and removes it on destruction.
-class KeepAliveImpl : public mojo::InterfaceImpl<KeepAlive> {
+class KeepAliveImpl : public KeepAlive {
public:
// Create a keep alive for |extension| running in |context| and connect it to
// |request|. When the requester closes its pipe, the keep alive ends.
@@ -27,11 +28,14 @@ class KeepAliveImpl : public mojo::InterfaceImpl<KeepAlive> {
mojo::InterfaceRequest<KeepAlive> request);
private:
- KeepAliveImpl(content::BrowserContext* context, const Extension* extension);
+ KeepAliveImpl(content::BrowserContext* context,
+ const Extension* extension,
+ mojo::InterfaceRequest<KeepAlive> request);
~KeepAliveImpl() override;
content::BrowserContext* context_;
const Extension* extension_;
+ mojo::StrongBinding<KeepAlive> binding_;
DISALLOW_COPY_AND_ASSIGN(KeepAliveImpl);
};