Commit f3670439 authored by sammc's avatar sammc Committed by Commit bot

Remove mojo::InterfaceImpl from render_thread_impl and web_ui_mojo_browsertest.

BUG=489751

Review URL: https://codereview.chromium.org/1146813003

Cr-Commit-Position: refs/heads/master@{#330838}
parent e761ca37
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "content/shell/browser/shell.h" #include "content/shell/browser/shell.h"
#include "content/test/data/web_ui_test_mojo_bindings.mojom.h" #include "content/test/data/web_ui_test_mojo_bindings.mojom.h"
#include "third_party/mojo/src/mojo/edk/test/test_utils.h" #include "third_party/mojo/src/mojo/edk/test/test_utils.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h" #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
#include "third_party/mojo/src/mojo/public/js/constants.h" #include "third_party/mojo/src/mojo/public/js/constants.h"
...@@ -60,13 +60,15 @@ bool GetResource(const std::string& id, ...@@ -60,13 +60,15 @@ bool GetResource(const std::string& id,
return true; return true;
} }
class BrowserTargetImpl : public mojo::InterfaceImpl<BrowserTarget> { class BrowserTargetImpl : public BrowserTarget {
public: public:
explicit BrowserTargetImpl(base::RunLoop* run_loop) : run_loop_(run_loop) {} BrowserTargetImpl(base::RunLoop* run_loop,
mojo::InterfaceRequest<BrowserTarget> request)
: run_loop_(run_loop), binding_(this, request.Pass()) {}
~BrowserTargetImpl() override {} ~BrowserTargetImpl() override {}
// mojo::InterfaceImpl<BrowserTarget> overrides: // BrowserTarget overrides:
void Start(const mojo::Closure& closure) override { void Start(const mojo::Closure& closure) override {
closure.Run(); closure.Run();
} }
...@@ -79,6 +81,7 @@ class BrowserTargetImpl : public mojo::InterfaceImpl<BrowserTarget> { ...@@ -79,6 +81,7 @@ class BrowserTargetImpl : public mojo::InterfaceImpl<BrowserTarget> {
base::RunLoop* run_loop_; base::RunLoop* run_loop_;
private: private:
mojo::Binding<BrowserTarget> binding_;
DISALLOW_COPY_AND_ASSIGN(BrowserTargetImpl); DISALLOW_COPY_AND_ASSIGN(BrowserTargetImpl);
}; };
...@@ -119,8 +122,7 @@ class PingTestWebUIController : public TestWebUIController { ...@@ -119,8 +122,7 @@ class PingTestWebUIController : public TestWebUIController {
} }
void CreateHandler(mojo::InterfaceRequest<BrowserTarget> request) { void CreateHandler(mojo::InterfaceRequest<BrowserTarget> request) {
browser_target_.reset(mojo::WeakBindToRequest( browser_target_.reset(new BrowserTargetImpl(run_loop_, request.Pass()));
new BrowserTargetImpl(run_loop_), &request));
} }
private: private:
......
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
#include "third_party/WebKit/public/web/WebSecurityPolicy.h" #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebView.h" #include "third_party/WebKit/public/web/WebView.h"
#include "third_party/icu/source/i18n/unicode/timezone.h" #include "third_party/icu/source/i18n/unicode/timezone.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
#include "third_party/skia/include/core/SkGraphics.h" #include "third_party/skia/include/core/SkGraphics.h"
#include "ui/base/layout.h" #include "ui/base/layout.h"
#include "ui/base/ui_base_switches.h" #include "ui/base/ui_base_switches.h"
...@@ -340,11 +341,11 @@ void LowMemoryNotificationOnThisThread() { ...@@ -340,11 +341,11 @@ void LowMemoryNotificationOnThisThread() {
isolate->LowMemoryNotification(); isolate->LowMemoryNotification();
} }
class RenderFrameSetupImpl : public mojo::InterfaceImpl<RenderFrameSetup> { class RenderFrameSetupImpl : public RenderFrameSetup {
public: public:
RenderFrameSetupImpl() explicit RenderFrameSetupImpl(
: routing_id_highmark_(-1) { mojo::InterfaceRequest<RenderFrameSetup> request)
} : routing_id_highmark_(-1), binding_(this, request.Pass()) {}
void ExchangeServiceProviders( void ExchangeServiceProviders(
int32_t frame_routing_id, int32_t frame_routing_id,
...@@ -371,10 +372,11 @@ class RenderFrameSetupImpl : public mojo::InterfaceImpl<RenderFrameSetup> { ...@@ -371,10 +372,11 @@ class RenderFrameSetupImpl : public mojo::InterfaceImpl<RenderFrameSetup> {
private: private:
int32_t routing_id_highmark_; int32_t routing_id_highmark_;
mojo::StrongBinding<RenderFrameSetup> binding_;
}; };
void CreateRenderFrameSetup(mojo::InterfaceRequest<RenderFrameSetup> request) { void CreateRenderFrameSetup(mojo::InterfaceRequest<RenderFrameSetup> request) {
mojo::BindToRequest(new RenderFrameSetupImpl(), &request); new RenderFrameSetupImpl(request.Pass());
} }
blink::WebGraphicsContext3D::Attributes GetOffscreenAttribs() { blink::WebGraphicsContext3D::Attributes GetOffscreenAttribs() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment