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

Unified Diff: content/child/mojo/mojo_application.cc

Issue 1901513003: Re-land: "Use a token to initialise ChannelMojo and MojoApplication everywhere." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « content/child/mojo/mojo_application.h ('k') | content/common/content_message_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/mojo/mojo_application.cc
diff --git a/content/child/mojo/mojo_application.cc b/content/child/mojo/mojo_application.cc
index 833f299751cd2a054e1d23d7423da4842018c38f..7aa45979ac8e4ce18aa6301b672bf592e6c49f01 100644
--- a/content/child/mojo/mojo_application.cc
+++ b/content/child/mojo/mojo_application.cc
@@ -6,36 +6,19 @@
#include <utility>
-#include "build/build_config.h"
-#include "content/child/child_process.h"
+#include "base/logging.h"
#include "content/common/application_setup.mojom.h"
-#include "content/common/mojo/channel_init.h"
-#include "content/common/mojo/mojo_messages.h"
-#include "ipc/ipc_message.h"
#include "mojo/edk/embedder/embedder.h"
-#include "mojo/public/cpp/bindings/interface_ptr.h"
namespace content {
-MojoApplication::MojoApplication(
- scoped_refptr<base::SequencedTaskRunner> io_task_runner)
- : io_task_runner_(io_task_runner) {
- DCHECK(io_task_runner_);
+MojoApplication::MojoApplication() {
}
MojoApplication::~MojoApplication() {
}
-bool MojoApplication::OnMessageReceived(const IPC::Message& msg) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(MojoApplication, msg)
- IPC_MESSAGE_HANDLER(MojoMsg_Activate, OnActivate)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void MojoApplication::InitWithToken(std::string token) {
+void MojoApplication::InitWithToken(const std::string& token) {
mojo::ScopedMessagePipeHandle handle =
mojo::edk::CreateChildMessagePipe(token);
DCHECK(handle.is_valid());
@@ -52,28 +35,4 @@ void MojoApplication::InitWithToken(std::string token) {
service_registry_.BindRemoteServiceProvider(std::move(services));
}
-void MojoApplication::OnActivate(
- const IPC::PlatformFileForTransit& file) {
-#if defined(OS_POSIX)
- base::PlatformFile handle = file.fd;
-#elif defined(OS_WIN)
- base::PlatformFile handle = file.GetHandle();
-#endif
-
- mojo::ScopedMessagePipeHandle pipe =
- channel_init_.Init(handle, io_task_runner_);
- DCHECK(pipe.is_valid());
-
- mojom::ApplicationSetupPtr application_setup;
- application_setup.Bind(
- mojo::InterfacePtrInfo<mojom::ApplicationSetup>(std::move(pipe), 0u));
-
- shell::mojom::InterfaceProviderPtr services;
- shell::mojom::InterfaceProviderPtr exposed_services;
- service_registry_.Bind(GetProxy(&exposed_services));
- application_setup->ExchangeInterfaceProviders(GetProxy(&services),
- std::move(exposed_services));
- service_registry_.BindRemoteServiceProvider(std::move(services));
-}
-
} // namespace content
« no previous file with comments | « content/child/mojo/mojo_application.h ('k') | content/common/content_message_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698