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

Unified Diff: services/ui/common/gpu_type_converters.cc

Issue 2247183005: services/ui: Get rid of IPC::ChannelHandle type converter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review issues Created 4 years, 4 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 | « services/ui/common/gpu_type_converters.h ('k') | services/ui/common/gpu_type_converters_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/common/gpu_type_converters.cc
diff --git a/services/ui/common/gpu_type_converters.cc b/services/ui/common/gpu_type_converters.cc
index f3873370d13cdeebb66beca19773b59943f63e59..0fc725d37f0fd10686a0ffd511a237bcc0f42d88 100644
--- a/services/ui/common/gpu_type_converters.cc
+++ b/services/ui/common/gpu_type_converters.cc
@@ -6,7 +6,6 @@
#include "build/build_config.h"
#include "gpu/config/gpu_info.h"
-#include "ipc/ipc_channel_handle.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "ui/gfx/gpu_memory_buffer.h"
@@ -16,48 +15,6 @@
namespace mojo {
-// static
-ui::mojom::ChannelHandlePtr
-TypeConverter<ui::mojom::ChannelHandlePtr, IPC::ChannelHandle>::Convert(
- const IPC::ChannelHandle& handle) {
- ui::mojom::ChannelHandlePtr result = ui::mojom::ChannelHandle::New();
- result->name = handle.name;
-#if defined(OS_WIN)
- // On windows, a pipe handle Will NOT be marshalled over IPC.
- DCHECK(handle.pipe.handle == NULL);
-#else
- DCHECK(handle.socket.auto_close || handle.socket.fd == -1);
- base::PlatformFile platform_file = handle.socket.fd;
- if (platform_file != -1)
- result->socket = mojo::WrapPlatformFile(platform_file);
-#endif
- result->mojo_handle.reset(handle.mojo_handle);
- return result;
-}
-
-// static
-IPC::ChannelHandle
-TypeConverter<IPC::ChannelHandle, ui::mojom::ChannelHandlePtr>::Convert(
- const ui::mojom::ChannelHandlePtr& handle) {
- if (handle.is_null())
- return IPC::ChannelHandle();
- if (handle->mojo_handle.is_valid()) {
- IPC::ChannelHandle channel_handle(handle->mojo_handle.release());
- channel_handle.name = handle->name;
- return channel_handle;
- }
-#if defined(OS_WIN)
- // On windows, a pipe handle Will NOT be marshalled over IPC.
- DCHECK(!handle->socket.is_valid());
- return IPC::ChannelHandle(handle->name);
-#else
- base::PlatformFile platform_file = -1;
- mojo::UnwrapPlatformFile(std::move(handle->socket), &platform_file);
- return IPC::ChannelHandle(handle->name,
- base::FileDescriptor(platform_file, true));
-#endif
-}
-
#if defined(USE_OZONE)
// static
ui::mojom::NativePixmapHandlePtr TypeConverter<
« no previous file with comments | « services/ui/common/gpu_type_converters.h ('k') | services/ui/common/gpu_type_converters_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698