diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-25 00:40:32 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-25 00:40:32 +0000 |
commit | 9916ecfd2efc8760aa1f60a008591bd59dd89eee (patch) | |
tree | 823d8e78c06a98e05947cba0f5f54ab3f1ee14bf /content/browser/webui/web_ui_mojo_browsertest.cc | |
parent | 0bab85619ab754150ec1a30f7dcc5f82ec72f687 (diff) | |
download | chromium_src-9916ecfd2efc8760aa1f60a008591bd59dd89eee.zip chromium_src-9916ecfd2efc8760aa1f60a008591bd59dd89eee.tar.gz chromium_src-9916ecfd2efc8760aa1f60a008591bd59dd89eee.tar.bz2 |
Revert 279557 "Support exposing Mojo services between render fra..."
Causing compile failure:
http://build.chromium.org/p/chromium.linux/builders/Android%20Builder%20%28dbg%29/builds/60210
> Support exposing Mojo services between render frames, render threads, and their respective hosts.
>
> This introduces ServiceRegistry as an abstraction around providing
> services to and accessing services from a remote peer. In particular,
> this adds peered service registries to RenderProcessHost and
> RenderThread, and to RenderFrameHost and RenderFrame - the RenderFrame
> setup is implemented using the RenderProcessHost/RenderThread
> ServiceRegistry pair.
>
> This replaces the existing WebUI handle setup by adding a webUI
> controller service to the frame host registry and a corresponding
> request for the webUI controller service to the frame registry.
>
> BUG=386155
>
> Review URL: https://codereview.chromium.org/285333003
TBR=sammc@chromium.org
Review URL: https://codereview.chromium.org/352013002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/webui/web_ui_mojo_browsertest.cc')
-rw-r--r-- | content/browser/webui/web_ui_mojo_browsertest.cc | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/content/browser/webui/web_ui_mojo_browsertest.cc b/content/browser/webui/web_ui_mojo_browsertest.cc index 6261316..5007a8d 100644 --- a/content/browser/webui/web_ui_mojo_browsertest.cc +++ b/content/browser/webui/web_ui_mojo_browsertest.cc @@ -12,19 +12,15 @@ #include "base/strings/string_util.h" #include "content/browser/webui/web_ui_controller_factory_registry.h" #include "content/public/browser/browser_context.h" -#include "content/public/browser/render_frame_host.h" -#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui_controller.h" #include "content/public/browser/web_ui_data_source.h" #include "content/public/common/content_paths.h" #include "content/public/common/content_switches.h" -#include "content/public/common/service_registry.h" #include "content/public/common/url_utils.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" -#include "content/shell/browser/shell.h" #include "content/test/data/web_ui_test_mojo_bindings.mojom.h" #include "grit/content_resources.h" #include "mojo/common/test/test_utils.h" @@ -129,18 +125,13 @@ class PingTestWebUIController : public TestWebUIController { PingTestWebUIController(WebUI* web_ui, base::RunLoop* run_loop) : TestWebUIController(web_ui, run_loop) { } - virtual ~PingTestWebUIController() {} // WebUIController overrides: virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE { - render_view_host->GetMainFrame()->GetServiceRegistry()->AddService( - "webui_controller", - base::Bind(&PingTestWebUIController::CreateHandler, - base::Unretained(this))); - } - - void CreateHandler(mojo::ScopedMessagePipeHandle handle) { - browser_target_.reset(new PingBrowserTargetImpl(handle.Pass(), run_loop_)); + mojo::MessagePipe pipe; + browser_target_.reset( + new PingBrowserTargetImpl(pipe.handle0.Pass(), run_loop_)); + render_view_host->SetWebUIHandle(pipe.handle1.Pass()); } private: @@ -221,19 +212,6 @@ IN_PROC_BROWSER_TEST_F(WebUIMojoTest, EndToEndPing) { // RunLoop is quit when message received from page. run_loop.Run(); EXPECT_TRUE(got_message); - - // Check that a second render frame in the same renderer process works - // correctly. - Shell* other_shell = CreateBrowser(); - got_message = false; - base::RunLoop other_run_loop; - factory()->set_run_loop(&other_run_loop); - NavigateToURL(other_shell, test_url); - // RunLoop is quit when message received from page. - other_run_loop.Run(); - EXPECT_TRUE(got_message); - EXPECT_EQ(shell()->web_contents()->GetRenderProcessHost(), - other_shell->web_contents()->GetRenderProcessHost()); } } // namespace |