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

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

Issue 649533003: C++11 declares a type safe null pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Presubmit errors Created 6 years, 2 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/content_ipc_logging.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 17 matching lines...) Expand all
28 blink::WebFallbackFont* fallbackFont) { 28 blink::WebFallbackFont* fallbackFont) {
29 TRACE_EVENT0("sandbox_ipc", "GetFontFamilyForCharacter"); 29 TRACE_EVENT0("sandbox_ipc", "GetFontFamilyForCharacter");
30 30
31 Pickle request; 31 Pickle request;
32 request.WriteInt(LinuxSandbox::METHOD_GET_FALLBACK_FONT_FOR_CHAR); 32 request.WriteInt(LinuxSandbox::METHOD_GET_FALLBACK_FONT_FOR_CHAR);
33 request.WriteInt(character); 33 request.WriteInt(character);
34 request.WriteString(preferred_locale); 34 request.WriteString(preferred_locale);
35 35
36 uint8_t buf[512]; 36 uint8_t buf[512];
37 const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf, 37 const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf,
38 sizeof(buf), NULL, request); 38 sizeof(buf),
39 nullptr, request);
39 40
40 std::string family_name; 41 std::string family_name;
41 std::string filename; 42 std::string filename;
42 int fontconfigInterfaceId = 0; 43 int fontconfigInterfaceId = 0;
43 int ttcIndex = 0; 44 int ttcIndex = 0;
44 bool isBold = false; 45 bool isBold = false;
45 bool isItalic = false; 46 bool isItalic = false;
46 if (n != -1) { 47 if (n != -1) {
47 Pickle reply(reinterpret_cast<char*>(buf), n); 48 Pickle reply(reinterpret_cast<char*>(buf), n);
48 PickleIterator pickle_iter(reply); 49 PickleIterator pickle_iter(reply);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 81
81 Pickle request; 82 Pickle request;
82 request.WriteInt(LinuxSandbox::METHOD_GET_STYLE_FOR_STRIKE); 83 request.WriteInt(LinuxSandbox::METHOD_GET_STYLE_FOR_STRIKE);
83 request.WriteString(family); 84 request.WriteString(family);
84 request.WriteBool(bold); 85 request.WriteBool(bold);
85 request.WriteBool(italic); 86 request.WriteBool(italic);
86 request.WriteUInt16(pixel_size); 87 request.WriteUInt16(pixel_size);
87 88
88 uint8_t buf[512]; 89 uint8_t buf[512];
89 const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf, 90 const ssize_t n = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), buf,
90 sizeof(buf), NULL, request); 91 sizeof(buf),
92 nullptr, request);
91 if (n == -1) 93 if (n == -1)
92 return; 94 return;
93 95
94 Pickle reply(reinterpret_cast<char*>(buf), n); 96 Pickle reply(reinterpret_cast<char*>(buf), n);
95 PickleIterator pickle_iter(reply); 97 PickleIterator pickle_iter(reply);
96 int use_bitmaps, use_autohint, use_hinting, hint_style, use_antialias; 98 int use_bitmaps, use_autohint, use_hinting, hint_style, use_antialias;
97 int use_subpixel_rendering, use_subpixel_positioning; 99 int use_subpixel_rendering, use_subpixel_positioning;
98 if (reply.ReadInt(&pickle_iter, &use_bitmaps) && 100 if (reply.ReadInt(&pickle_iter, &use_bitmaps) &&
99 reply.ReadInt(&pickle_iter, &use_autohint) && 101 reply.ReadInt(&pickle_iter, &use_autohint) &&
100 reply.ReadInt(&pickle_iter, &use_hinting) && 102 reply.ReadInt(&pickle_iter, &use_hinting) &&
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 208 }
207 209
208 bool SendZygoteChildPing(int fd) { 210 bool SendZygoteChildPing(int fd) {
209 return UnixDomainSocket::SendMsg(fd, 211 return UnixDomainSocket::SendMsg(fd,
210 kZygoteChildPingMessage, 212 kZygoteChildPingMessage,
211 sizeof(kZygoteChildPingMessage), 213 sizeof(kZygoteChildPingMessage),
212 std::vector<int>()); 214 std::vector<int>());
213 } 215 }
214 216
215 } // namespace content 217 } // namespace content
OLDNEW
« no previous file with comments | « content/common/cc_messages.cc ('k') | content/common/content_ipc_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698