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

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

Issue 555503007: Cleanup: Get rid of OS_WIN/OS_POSIX ifdefs from MojoApplication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 6 years, 3 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_application_host.cc
diff --git a/content/browser/mojo/mojo_application_host.cc b/content/browser/mojo/mojo_application_host.cc
index b7529731ed4be3a531e128f87798472dab3c234d..591557a8880041078423f17a2303ec17d4ec726b 100644
--- a/content/browser/mojo/mojo_application_host.cc
+++ b/content/browser/mojo/mojo_application_host.cc
@@ -10,18 +10,6 @@
#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) {
}
@@ -35,7 +23,7 @@ bool MojoApplicationHost::Init() {
mojo::embedder::PlatformChannelPair channel_pair;
mojo::ScopedMessagePipeHandle message_pipe = channel_init_.Init(
- PlatformFileFromScopedPlatformHandle(channel_pair.PassServerHandle()),
+ channel_pair.PassServerHandle().release().platform_file(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
if (!message_pipe.is_valid())
return false;
@@ -52,8 +40,7 @@ void MojoApplicationHost::Activate(IPC::Sender* sender,
DCHECK(!did_activate_);
DCHECK(client_handle_.is_valid());
- base::PlatformFile client_file =
- PlatformFileFromScopedPlatformHandle(client_handle_.Pass());
+ base::PlatformFile client_file = client_handle_.release().platform_file();
did_activate_ = sender->Send(new MojoMsg_Activate(
IPC::GetFileHandleForProcess(client_file, process_handle, true)));
}

Powered by Google App Engine
This is Rietveld 408576698