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

Side by Side Diff: content/common/child_process_sandbox_support_impl_linux.cc

Issue 825353003: Revert of Remove deprecated methods from Pickle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « content/common/cc_messages.cc ('k') | content/common/common_param_traits_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/common/child_process_sandbox_support_impl_linux.h" 5 #include "content/common/child_process_sandbox_support_impl_linux.h"
6 6
7 #include <sys/stat.h> 7 #include <sys/stat.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 27 matching lines...) Expand all
38 38
39 std::string family_name; 39 std::string family_name;
40 std::string filename; 40 std::string filename;
41 int fontconfigInterfaceId = 0; 41 int fontconfigInterfaceId = 0;
42 int ttcIndex = 0; 42 int ttcIndex = 0;
43 bool isBold = false; 43 bool isBold = false;
44 bool isItalic = false; 44 bool isItalic = false;
45 if (n != -1) { 45 if (n != -1) {
46 Pickle reply(reinterpret_cast<char*>(buf), n); 46 Pickle reply(reinterpret_cast<char*>(buf), n);
47 PickleIterator pickle_iter(reply); 47 PickleIterator pickle_iter(reply);
48 if (pickle_iter.ReadString(&family_name) && 48 if (reply.ReadString(&pickle_iter, &family_name) &&
49 pickle_iter.ReadString(&filename) && 49 reply.ReadString(&pickle_iter, &filename) &&
50 pickle_iter.ReadInt(&fontconfigInterfaceId) && 50 reply.ReadInt(&pickle_iter, &fontconfigInterfaceId) &&
51 pickle_iter.ReadInt(&ttcIndex) && 51 reply.ReadInt(&pickle_iter, &ttcIndex) &&
52 pickle_iter.ReadBool(&isBold) && 52 reply.ReadBool(&pickle_iter, &isBold) &&
53 pickle_iter.ReadBool(&isItalic)) { 53 reply.ReadBool(&pickle_iter, &isItalic)) {
54 fallbackFont->name = family_name; 54 fallbackFont->name = family_name;
55 fallbackFont->filename = filename; 55 fallbackFont->filename = filename;
56 fallbackFont->fontconfigInterfaceId = fontconfigInterfaceId; 56 fallbackFont->fontconfigInterfaceId = fontconfigInterfaceId;
57 fallbackFont->ttcIndex = ttcIndex; 57 fallbackFont->ttcIndex = ttcIndex;
58 fallbackFont->isBold = isBold; 58 fallbackFont->isBold = isBold;
59 fallbackFont->isItalic = isItalic; 59 fallbackFont->isItalic = isItalic;
60 } 60 }
61 } 61 }
62 } 62 }
63 63
(...skipping 23 matching lines...) Expand all
87 uint8_t buf[512]; 87 uint8_t buf[512];
88 const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf, 88 const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf,
89 sizeof(buf), NULL, request); 89 sizeof(buf), NULL, request);
90 if (n == -1) 90 if (n == -1)
91 return; 91 return;
92 92
93 Pickle reply(reinterpret_cast<char*>(buf), n); 93 Pickle reply(reinterpret_cast<char*>(buf), n);
94 PickleIterator pickle_iter(reply); 94 PickleIterator pickle_iter(reply);
95 int use_bitmaps, use_autohint, use_hinting, hint_style, use_antialias; 95 int use_bitmaps, use_autohint, use_hinting, hint_style, use_antialias;
96 int use_subpixel_rendering, use_subpixel_positioning; 96 int use_subpixel_rendering, use_subpixel_positioning;
97 if (pickle_iter.ReadInt(&use_bitmaps) && 97 if (reply.ReadInt(&pickle_iter, &use_bitmaps) &&
98 pickle_iter.ReadInt(&use_autohint) && 98 reply.ReadInt(&pickle_iter, &use_autohint) &&
99 pickle_iter.ReadInt(&use_hinting) && 99 reply.ReadInt(&pickle_iter, &use_hinting) &&
100 pickle_iter.ReadInt(&hint_style) && 100 reply.ReadInt(&pickle_iter, &hint_style) &&
101 pickle_iter.ReadInt(&use_antialias) && 101 reply.ReadInt(&pickle_iter, &use_antialias) &&
102 pickle_iter.ReadInt(&use_subpixel_rendering) && 102 reply.ReadInt(&pickle_iter, &use_subpixel_rendering) &&
103 pickle_iter.ReadInt(&use_subpixel_positioning)) { 103 reply.ReadInt(&pickle_iter, &use_subpixel_positioning)) {
104 out->useBitmaps = use_bitmaps; 104 out->useBitmaps = use_bitmaps;
105 out->useAutoHint = use_autohint; 105 out->useAutoHint = use_autohint;
106 out->useHinting = use_hinting; 106 out->useHinting = use_hinting;
107 out->hintStyle = hint_style; 107 out->hintStyle = hint_style;
108 out->useAntiAlias = use_antialias; 108 out->useAntiAlias = use_antialias;
109 out->useSubpixelRendering = use_subpixel_rendering; 109 out->useSubpixelRendering = use_subpixel_rendering;
110 out->useSubpixelPositioning = use_subpixel_positioning; 110 out->useSubpixelPositioning = use_subpixel_positioning;
111 } 111 }
112 } 112 }
113 113
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 ssize_t n = HANDLE_EINTR(pread(fd, output, data_length, data_offset)); 198 ssize_t n = HANDLE_EINTR(pread(fd, output, data_length, data_offset));
199 if (n != base::checked_cast<ssize_t>(data_length)) 199 if (n != base::checked_cast<ssize_t>(data_length))
200 return false; 200 return false;
201 } 201 }
202 *output_length = data_length; 202 *output_length = data_length;
203 203
204 return true; 204 return true;
205 } 205 }
206 206
207 } // namespace content 207 } // namespace content
OLDNEW
« no previous file with comments | « content/common/cc_messages.cc ('k') | content/common/common_param_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698