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

Unified Diff: content/browser/webui/web_ui_mojo_browsertest.cc

Issue 1146813003: Remove mojo::InterfaceImpl from render_thread_impl and web_ui_mojo_browsertest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/web_ui_mojo_browsertest.cc
diff --git a/content/browser/webui/web_ui_mojo_browsertest.cc b/content/browser/webui/web_ui_mojo_browsertest.cc
index 847e39e759897e3d9d301b3c035fd3fce27c29d0..2b2f50aff69f10dc72b56287f58439157b09086c 100644
--- a/content/browser/webui/web_ui_mojo_browsertest.cc
+++ b/content/browser/webui/web_ui_mojo_browsertest.cc
@@ -26,7 +26,7 @@
#include "content/shell/browser/shell.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/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/js/constants.h"
@@ -60,13 +60,15 @@ bool GetResource(const std::string& id,
return true;
}
-class BrowserTargetImpl : public mojo::InterfaceImpl<BrowserTarget> {
+class BrowserTargetImpl : public BrowserTarget {
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 {}
- // mojo::InterfaceImpl<BrowserTarget> overrides:
+ // BrowserTarget overrides:
void Start(const mojo::Closure& closure) override {
closure.Run();
}
@@ -79,6 +81,7 @@ class BrowserTargetImpl : public mojo::InterfaceImpl<BrowserTarget> {
base::RunLoop* run_loop_;
private:
+ mojo::Binding<BrowserTarget> binding_;
DISALLOW_COPY_AND_ASSIGN(BrowserTargetImpl);
};
@@ -119,8 +122,7 @@ class PingTestWebUIController : public TestWebUIController {
}
void CreateHandler(mojo::InterfaceRequest<BrowserTarget> request) {
- browser_target_.reset(mojo::WeakBindToRequest(
- new BrowserTargetImpl(run_loop_), &request));
+ browser_target_.reset(new BrowserTargetImpl(run_loop_, request.Pass()));
}
private:
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698