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

Side by Side Diff: content/browser/renderer_host/render_sandbox_host_linux.cc

Issue 6602049: Pure pedantry: Replace all ".size() == 0" with ".empty()". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser/renderer_host/render_sandbox_host_linux.h" 5 #include "content/browser/renderer_host/render_sandbox_host_linux.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <fontconfig/fontconfig.h> 8 #include <fontconfig/fontconfig.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // error for a maximum length message. 113 // error for a maximum length message.
114 char buf[FontConfigInterface::kMaxFontFamilyLength + 128]; 114 char buf[FontConfigInterface::kMaxFontFamilyLength + 128];
115 115
116 const ssize_t len = UnixDomainSocket::RecvMsg(fd, buf, sizeof(buf), &fds); 116 const ssize_t len = UnixDomainSocket::RecvMsg(fd, buf, sizeof(buf), &fds);
117 if (len == -1) { 117 if (len == -1) {
118 // TODO: should send an error reply, or the sender might block forever. 118 // TODO: should send an error reply, or the sender might block forever.
119 NOTREACHED() 119 NOTREACHED()
120 << "Sandbox host message is larger than kMaxFontFamilyLength"; 120 << "Sandbox host message is larger than kMaxFontFamilyLength";
121 return; 121 return;
122 } 122 }
123 if (fds.size() == 0) 123 if (fds.empty())
124 return; 124 return;
125 125
126 Pickle pickle(buf, len); 126 Pickle pickle(buf, len);
127 void* iter = NULL; 127 void* iter = NULL;
128 128
129 int kind; 129 int kind;
130 if (!pickle.ReadInt(&iter, &kind)) 130 if (!pickle.ReadInt(&iter, &kind))
131 goto error; 131 goto error;
132 132
133 if (kind == FontConfigIPC::METHOD_MATCH) { 133 if (kind == FontConfigIPC::METHOD_MATCH) {
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 } 678 }
679 679
680 RenderSandboxHostLinux::~RenderSandboxHostLinux() { 680 RenderSandboxHostLinux::~RenderSandboxHostLinux() {
681 if (initialized_) { 681 if (initialized_) {
682 if (HANDLE_EINTR(close(renderer_socket_)) < 0) 682 if (HANDLE_EINTR(close(renderer_socket_)) < 0)
683 PLOG(ERROR) << "close"; 683 PLOG(ERROR) << "close";
684 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) 684 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0)
685 PLOG(ERROR) << "close"; 685 PLOG(ERROR) << "close";
686 } 686 }
687 } 687 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698