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

Unified Diff: content/browser/mojo/mojo_shell_client_host.cc

Issue 1554443003: Stop linking in the old Mojo EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and fix new flaky test Created 4 years, 11 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
Index: content/browser/mojo/mojo_shell_client_host.cc
diff --git a/content/browser/mojo/mojo_shell_client_host.cc b/content/browser/mojo/mojo_shell_client_host.cc
index 326afebb051636bf4198adc1479e6361ae15f62a..00fe808e72328d151fee5311fb80138dfc8af44d 100644
--- a/content/browser/mojo/mojo_shell_client_host.cc
+++ b/content/browser/mojo/mojo_shell_client_host.cc
@@ -18,11 +18,12 @@
#include "content/public/common/mojo_shell_connection.h"
#include "ipc/ipc_sender.h"
#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/public/cpp/system/message_pipe.h"
#include "mojo/shell/public/cpp/application_impl.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"
namespace content {
namespace {
@@ -30,17 +31,6 @@ namespace {
const char kMojoShellInstanceURL[] = "mojo_shell_instance_url";
const char kMojoPlatformFile[] = "mojo_platform_file";
-void DidCreateChannel(mojo::embedder::ChannelInfo* info) {}
-
-base::PlatformFile PlatformFileFromScopedPlatformHandle(
- mojo::embedder::ScopedPlatformHandle handle) {
-#if defined(OS_POSIX)
- return handle.release().fd;
-#elif defined(OS_WIN)
- return handle.release().handle;
-#endif
-}
-
class InstanceURL : public base::SupportsUserData::Data {
public:
InstanceURL(const std::string& instance_url) : instance_url_(instance_url) {}
@@ -133,15 +123,14 @@ void RegisterChildWithExternalShell(int child_process_id,
return;
// Create the channel to be shared with the target process.
- mojo::embedder::HandlePassingInformation handle_passing_info;
- mojo::embedder::PlatformChannelPair platform_channel_pair;
+ mojo::edk::HandlePassingInformation handle_passing_info;
+ 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(&DidCreateChannel),
- base::ThreadTaskRunnerHandle::Get()));
+ mojo::ScopedMessagePipeHandle handle(mojo::edk::CreateMessagePipe(
+ std::move(platform_channel)));
mojo::shell::mojom::ApplicationManagerPtr application_manager;
MojoShellConnection::Get()->GetApplication()->ConnectToService(
"mojo:shell", &application_manager);
@@ -167,8 +156,8 @@ void RegisterChildWithExternalShell(int child_process_id,
std::move(request));
// Send the other end to the child via Chrome IPC.
- base::PlatformFile client_file = PlatformFileFromScopedPlatformHandle(
- platform_channel_pair.PassClientHandle());
+ base::PlatformFile client_file =
+ platform_channel_pair.PassClientHandle().release().handle;
SetMojoPlatformFile(render_process_host, client_file);
// Store the URL on the RPH so client code can access it later via
@@ -194,12 +183,12 @@ void SendExternalMojoShellHandleToChild(
IPC::GetFileHandleForProcess(client_file->get(), process_handle, true)));
}
-mojo::embedder::ScopedPlatformHandle RegisterProcessWithBroker(
+mojo::edk::ScopedPlatformHandle RegisterProcessWithBroker(
base::ProcessId pid) {
- mojo::embedder::PlatformChannelPair platform_channel_pair;
+ mojo::edk::PlatformChannelPair platform_channel_pair;
MojoHandle platform_handle_wrapper;
- MojoResult rv = mojo::embedder::CreatePlatformHandleWrapper(
+ MojoResult rv = mojo::edk::CreatePlatformHandleWrapper(
platform_channel_pair.PassServerHandle(), &platform_handle_wrapper);
CHECK_EQ(rv, MOJO_RESULT_OK);
« no previous file with comments | « content/browser/mojo/mojo_shell_client_host.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698