diff options
author | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-23 19:44:12 +0000 |
---|---|---|
committer | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-23 19:44:12 +0000 |
commit | 2442605058353f23d08db64f39cff92c48f7e8e6 (patch) | |
tree | ebf320d62c8b12271629e9c9619eefd0f07d4562 /content/browser/mojo/mojo_application_host.cc | |
parent | 0cfda3032843c4769cbd68ddc3c83e1753d0e611 (diff) | |
download | chromium_src-2442605058353f23d08db64f39cff92c48f7e8e6.zip chromium_src-2442605058353f23d08db64f39cff92c48f7e8e6.tar.gz chromium_src-2442605058353f23d08db64f39cff92c48f7e8e6.tar.bz2 |
Revert 265693 "Move Mojo channel initialization closer to IPC::C..."
This is causing runhooks failures on the iOS build bots.
> 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}.
>
> R=sky@chromium.org, tsepez@chromium.org
>
> Review URL: https://codereview.chromium.org/236813002
TBR=darin@chromium.org
Review URL: https://codereview.chromium.org/247953005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/mojo/mojo_application_host.cc')
-rw-r--r-- | content/browser/mojo/mojo_application_host.cc | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/content/browser/mojo/mojo_application_host.cc b/content/browser/mojo/mojo_application_host.cc deleted file mode 100644 index 48d343a..0000000 --- a/content/browser/mojo/mojo_application_host.cc +++ /dev/null @@ -1,65 +0,0 @@ -// 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. - -#include "content/browser/mojo/mojo_application_host.h" - -#include "content/common/mojo/mojo_messages.h" -#include "content/public/browser/browser_thread.h" -#include "ipc/ipc_sender.h" -#include "mojo/embedder/platform_channel_pair.h" - -namespace content { -namespace { - -base::PlatformFile PlatformFileFromScopedPlatformHandle( - mojo::embedder::ScopedPlatformHandle handle) { -#if defined(OS_POSIX) - return handle.release().fd; -#elif defined(OS_WIN) - return handle.release().handle; -#endif -} - -} // namespace - -MojoApplicationHost::MojoApplicationHost() : did_activate_(false) { -} - -MojoApplicationHost::~MojoApplicationHost() { -} - -bool MojoApplicationHost::Init() { - DCHECK(shell_client_.is_null()) << "Already initialized!"; - - mojo::embedder::PlatformChannelPair channel_pair; - - mojo::ScopedMessagePipeHandle message_pipe = channel_init_.Init( - PlatformFileFromScopedPlatformHandle(channel_pair.PassServerHandle()), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); - if (!message_pipe.is_valid()) - return false; - - // Forward this to the client once we know its process handle. - client_handle_ = channel_pair.PassClientHandle(); - - // TODO(darin): Provide a Shell implementation - shell_client_.reset( - mojo::ScopedShellClientHandle::From(message_pipe.Pass()), NULL); - - return true; -} - -bool MojoApplicationHost::Activate(IPC::Sender* sender, - base::ProcessHandle process_handle) { - DCHECK(!did_activate_); - DCHECK(client_handle_.is_valid()); - - base::PlatformFile client_file = - PlatformFileFromScopedPlatformHandle(client_handle_.Pass()); - did_activate_ = sender->Send(new MojoMsg_Activate( - IPC::GetFileHandleForProcess(client_file, process_handle, true))); - return did_activate_; -} - -} // namespace content |