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

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 1532813002: Replace IOSurfaceManager by directly passing IOSurface Mach ports over Chrome IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows compile Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/ipc_message_utils.h" 5 #include "ipc/ipc_message_utils.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/nullable_string16.h" 10 #include "base/strings/nullable_string16.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "ipc/ipc_channel_handle.h" 15 #include "ipc/ipc_channel_handle.h"
16 #include "ipc/ipc_message_attachment.h" 16 #include "ipc/ipc_message_attachment.h"
17 #include "ipc/ipc_message_attachment_set.h" 17 #include "ipc/ipc_message_attachment_set.h"
18 18
19 #if defined(OS_POSIX) 19 #if defined(OS_POSIX)
20 #include "ipc/ipc_platform_file_attachment_posix.h" 20 #include "ipc/ipc_platform_file_attachment_posix.h"
21 #endif 21 #endif
22 22
23 #if (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN) 23 #if (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN)
24 #include "base/memory/shared_memory_handle.h" 24 #include "base/memory/shared_memory_handle.h"
25 #endif // (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN) 25 #endif // (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN)
26 26
27 #if defined(OS_MACOSX) && !defined(OS_IOS) 27 #if defined(OS_MACOSX) && !defined(OS_IOS)
28 #include "base/mac/scoped_mach_port.h"
28 #include "ipc/mach_port_mac.h" 29 #include "ipc/mach_port_mac.h"
29 #endif 30 #endif
30 31
31 #if defined(OS_WIN) 32 #if defined(OS_WIN)
32 #include <tchar.h> 33 #include <tchar.h>
33 #include "ipc/handle_win.h" 34 #include "ipc/handle_win.h"
34 #endif 35 #endif
35 36
36 namespace IPC { 37 namespace IPC {
37 38
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 1038
1038 return result; 1039 return result;
1039 } 1040 }
1040 1041
1041 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { 1042 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) {
1042 l->append("<MSG>"); 1043 l->append("<MSG>");
1043 } 1044 }
1044 1045
1045 #endif // OS_WIN 1046 #endif // OS_WIN
1046 1047
1048 #if defined(OS_MACOSX) && !defined(OS_IOS)
1049 void ParamTraits<base::mac::ScopedRefCountedMachSendRight>::Write(
1050 Message* m,
1051 const param_type p) {
1052 MachPortMac mach_port_mac(p.get());
1053 ParamTraits<MachPortMac>::Write(m, mach_port_mac);
1054 }
1055
1056 bool ParamTraits<base::mac::ScopedRefCountedMachSendRight>::Read(
erikchen 2015/12/21 20:02:57 The Chrome IPC stack doesn't have the right semant
Robert Sesek 2015/12/21 20:33:54 The issue here is that GpuMemoryBufferHandle is bo
1057 const Message* m,
1058 base::PickleIterator* iter,
1059 param_type* r) {
1060 MachPortMac mach_port_mac;
1061 if (!ParamTraits<MachPortMac>::Read(m, iter, &mach_port_mac))
1062 return false;
1063 r->reset(mach_port_mac.get_mach_port());
1064 return true;
1065 }
1066
1067 void ParamTraits<base::mac::ScopedRefCountedMachSendRight>::Log(
1068 const param_type& p,
1069 std::string* l) {
1070 l->append("Mach send right: ");
1071 LogParam(p.get(), l);
1072 }
1073 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
1074
1047 } // namespace IPC 1075 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698