Index: mojo/shell/application_manager_apptest_driver.cc |
diff --git a/mojo/shell/application_manager_apptest_driver.cc b/mojo/shell/application_manager_apptest_driver.cc |
index 9de6d410c9b326fe401184725a9d4aa2322fa8ae..6a310f99d775b7daa96f145251f029246db7616e 100644 |
--- a/mojo/shell/application_manager_apptest_driver.cc |
+++ b/mojo/shell/application_manager_apptest_driver.cc |
@@ -22,6 +22,7 @@ |
#include "mojo/converters/network/network_type_converters.h" |
#include "mojo/edk/embedder/embedder.h" |
#include "mojo/edk/embedder/platform_channel_pair.h" |
+#include "mojo/edk/embedder/scoped_platform_handle.h" |
#include "mojo/runner/child/test_native_main.h" |
#include "mojo/runner/init.h" |
#include "mojo/shell/application_manager_apptests.mojom.h" |
@@ -30,9 +31,6 @@ |
#include "mojo/shell/public/cpp/application_impl.h" |
#include "mojo/shell/public/cpp/interface_factory.h" |
#include "mojo/shell/public/interfaces/application_manager.mojom.h" |
-#include "third_party/mojo/src/mojo/edk/embedder/embedder.h" |
-#include "third_party/mojo/src/mojo/edk/embedder/platform_channel_pair.h" |
-#include "third_party/mojo/src/mojo/edk/embedder/scoped_platform_handle.h" |
using mojo::shell::test::mojom::Driver; |
@@ -69,35 +67,28 @@ class TargetApplicationDelegate : public mojo::ApplicationDelegate, |
switches::kWaitForDebugger)) { |
child_command_line.AppendSwitch(switches::kWaitForDebugger); |
} |
- if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) |
- child_command_line.AppendSwitch("use-new-edk"); |
- mojo::embedder::HandlePassingInformation handle_passing_info; |
+ mojo::edk::HandlePassingInformation handle_passing_info; |
// Create the channel to be shared with the target process. |
- mojo::embedder::PlatformChannelPair platform_channel_pair; |
+ mojo::edk::PlatformChannelPair platform_channel_pair; |
// Give one end to the shell so that it can create an instance. |
- mojo::embedder::ScopedPlatformHandle platform_channel = |
+ mojo::edk::ScopedPlatformHandle platform_channel = |
platform_channel_pair.PassServerHandle(); |
- mojo::ScopedMessagePipeHandle handle(mojo::embedder::CreateChannel( |
- std::move(platform_channel), |
- base::Bind(&TargetApplicationDelegate::DidCreateChannel, |
- weak_factory_.GetWeakPtr()), |
- base::ThreadTaskRunnerHandle::Get())); |
+ mojo::ScopedMessagePipeHandle handle(mojo::edk::CreateMessagePipe( |
+ std::move(platform_channel))); |
// The platform handle used for the new EDK's broker. |
mojo::edk::PlatformChannelPair broker_channel_pair; |
- if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) { |
- std::string client_handle_as_string = |
- broker_channel_pair.PrepareToPassClientHandleToChildProcessAsString( |
- &handle_passing_info); |
- MojoResult rv = MojoWriteMessage( |
- handle.get().value(), client_handle_as_string.c_str(), |
- static_cast<uint32_t>(client_handle_as_string.size()), nullptr, 0, |
- MOJO_WRITE_MESSAGE_FLAG_NONE); |
- DCHECK_EQ(rv, MOJO_RESULT_OK); |
- } |
+ std::string client_handle_as_string = |
+ broker_channel_pair.PrepareToPassClientHandleToChildProcessAsString( |
+ &handle_passing_info); |
+ MojoResult rv = MojoWriteMessage( |
+ handle.get().value(), client_handle_as_string.c_str(), |
+ static_cast<uint32_t>(client_handle_as_string.size()), nullptr, 0, |
+ MOJO_WRITE_MESSAGE_FLAG_NONE); |
+ DCHECK_EQ(rv, MOJO_RESULT_OK); |
mojo::CapabilityFilterPtr filter(mojo::CapabilityFilter::New()); |
mojo::Array<mojo::String> test_interfaces; |
@@ -126,15 +117,13 @@ class TargetApplicationDelegate : public mojo::ApplicationDelegate, |
DCHECK(target_.IsValid()); |
receiver->SetPID(target_.Pid()); |
- if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) { |
- MojoHandle platform_handle_wrapper; |
- MojoResult rv = mojo::edk::CreatePlatformHandleWrapper( |
- broker_channel_pair.PassServerHandle(), &platform_handle_wrapper); |
- DCHECK_EQ(rv, MOJO_RESULT_OK); |
- application_manager->RegisterProcessWithBroker( |
- target_.Pid(), |
- mojo::ScopedHandle(mojo::Handle(platform_handle_wrapper))); |
- } |
+ MojoHandle platform_handle_wrapper; |
+ rv = mojo::edk::CreatePlatformHandleWrapper( |
+ broker_channel_pair.PassServerHandle(), &platform_handle_wrapper); |
+ DCHECK_EQ(rv, MOJO_RESULT_OK); |
+ application_manager->RegisterProcessWithBroker( |
+ target_.Pid(), |
+ mojo::ScopedHandle(mojo::Handle(platform_handle_wrapper))); |
} |
bool ConfigureIncomingConnection( |
mojo::ApplicationConnection* connection) override { |
@@ -154,8 +143,6 @@ class TargetApplicationDelegate : public mojo::ApplicationDelegate, |
app_->Quit(); |
} |
- void DidCreateChannel(mojo::embedder::ChannelInfo* channel_info) {} |
- |
mojo::ApplicationImpl* app_; |
base::Process target_; |
mojo::WeakBindingSet<Driver> bindings_; |