diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-24 18:17:53 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-24 18:17:53 +0000 |
commit | f68c14642a91a765ed6874e4868606afe1b08e40 (patch) | |
tree | 050120e681468fe42bb986cf10e6665335a3d328 /content/renderer/web_ui_setup_impl.h | |
parent | c0b5b764bba1ad79606b48a76d3c215b63730a1e (diff) | |
download | chromium_src-f68c14642a91a765ed6874e4868606afe1b08e40.zip chromium_src-f68c14642a91a765ed6874e4868606afe1b08e40.tar.gz chromium_src-f68c14642a91a765ed6874e4868606afe1b08e40.tar.bz2 |
Move Mojo channel initialization closer to IPC::Channel setup
This CL introduces two new content classes:
- MojoApplicationHost encapsulates what's needed to host a Mojo App using Chrome IPC to bootstrap.
- MojoApplication represents what's needed to be a Mojo App using Chrome IPC to bootstrap.
The RenderProcess and RenderProcessHost interfaces are replaced with WebUISetup and WebUISetupClient interfaces. This way the interface is more specific to the service of setting up WebUI.
WebUISetupClient is empty and uninteresting. RenderProcessHostImpl no longer deals with WebUI setup. That is all done directly by RenderViewHostImpl by talking to the WebUISetup service.
Service names get defined in content/common/mojo/mojo_service_names.{h,cc}.
TBR=sky@chromium.org, tsepez@chromium.org
Originally reviewed at https://codereview.chromium.org/236813002/
Review URL: https://codereview.chromium.org/256403004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/web_ui_setup_impl.h')
-rw-r--r-- | content/renderer/web_ui_setup_impl.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/content/renderer/web_ui_setup_impl.h b/content/renderer/web_ui_setup_impl.h new file mode 100644 index 0000000..1bfc6ca --- /dev/null +++ b/content/renderer/web_ui_setup_impl.h @@ -0,0 +1,39 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_RENDERER_WEB_UI_SETUP_IMPL_H_ +#define CONTENT_RENDERER_WEB_UI_SETUP_IMPL_H_ + +#include "base/basictypes.h" +#include "content/common/web_ui_setup.mojom.h" +#include "mojo/public/cpp/bindings/error_handler.h" +#include "mojo/public/cpp/bindings/remote_ptr.h" + +namespace content { + +class WebUISetupImpl : public WebUISetup, + public mojo::ErrorHandler { + public: + static void Bind(mojo::ScopedMessagePipeHandle handle); + + private: + explicit WebUISetupImpl(mojo::ScopedMessagePipeHandle handle); + virtual ~WebUISetupImpl(); + + // WebUISetup methods: + virtual void SetWebUIHandle( + int32_t view_routing_id, + mojo::ScopedMessagePipeHandle web_ui_handle) OVERRIDE; + + // mojo::ErrorHandler methods: + virtual void OnError() OVERRIDE; + + mojo::RemotePtr<WebUISetupClient> client_; + + DISALLOW_COPY_AND_ASSIGN(WebUISetupImpl); +}; + +} // namespace content + +#endif // CONTENT_RENDERER_WEB_UI_SETUP_IMPL_H_ |