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

Unified Diff: content/browser/renderer_host/sandbox_ipc_linux.cc

Issue 2255013002: Minor cleanup in SandboxIPCHandler and ZygoteMain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | content/zygote/zygote_main_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/sandbox_ipc_linux.cc
diff --git a/content/browser/renderer_host/sandbox_ipc_linux.cc b/content/browser/renderer_host/sandbox_ipc_linux.cc
index d27a2435547089c29237d067024191a309fb1f8b..eac3a3235296637ba94f9d070360d73fecb11e68 100644
--- a/content/browser/renderer_host/sandbox_ipc_linux.cc
+++ b/content/browser/renderer_host/sandbox_ipc_linux.cc
@@ -221,11 +221,7 @@ void SandboxIPCHandler::HandleFontOpenRequest(
const int result_fd = open(paths_[index].c_str(), O_RDONLY);
base::Pickle reply;
- if (result_fd == -1) {
- reply.WriteBool(false);
- } else {
- reply.WriteBool(true);
- }
+ reply.WriteBool(result_fd != -1);
// The receiver will have its own access to the file, so we will close it
// after this send.
@@ -271,7 +267,8 @@ void SandboxIPCHandler::HandleGetStyleForStrike(
base::PickleIterator iter,
const std::vector<base::ScopedFD>& fds) {
std::string family;
- bool bold, italic;
+ bool bold;
+ bool italic;
uint16_t pixel_size;
if (!iter.ReadString(&family) ||
@@ -286,7 +283,7 @@ void SandboxIPCHandler::HandleGetStyleForStrike(
query.pixel_size = pixel_size;
query.style = italic ? gfx::Font::ITALIC : 0;
query.weight = bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL;
- const gfx::FontRenderParams params = gfx::GetFontRenderParams(query, NULL);
+ const gfx::FontRenderParams params = gfx::GetFontRenderParams(query, nullptr);
// These are passed as ints since they're interpreted as tri-state chars in
// Blink.
@@ -320,7 +317,7 @@ void SandboxIPCHandler::HandleLocaltime(
std::string result_string;
const char* time_zone_string = "";
- if (expanded_time != NULL) {
+ if (expanded_time) {
result_string = std::string(reinterpret_cast<const char*>(expanded_time),
sizeof(struct tm));
time_zone_string = expanded_time->tm_zone;
@@ -356,8 +353,10 @@ void SandboxIPCHandler::HandleMatchWithFallback(
base::PickleIterator iter,
const std::vector<base::ScopedFD>& fds) {
std::string face;
- bool is_bold, is_italic;
- uint32_t charset, fallback_family;
+ bool is_bold;
+ bool is_italic;
+ uint32_t charset;
+ uint32_t fallback_family;
if (!iter.ReadString(&face) || face.empty() ||
!iter.ReadBool(&is_bold) ||
« no previous file with comments | « no previous file | content/zygote/zygote_main_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698