| 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 1437321c540ac5cfe49636d91a8622d5aef4ec23..b2e024e1e8cedfe6fd1e27f420355b64abf335db 100644
|
| --- a/content/browser/renderer_host/sandbox_ipc_linux.cc
|
| +++ b/content/browser/renderer_host/sandbox_ipc_linux.cc
|
| @@ -144,23 +144,23 @@
|
| PickleIterator iter(pickle);
|
|
|
| int kind;
|
| - if (!iter.ReadInt(&kind))
|
| + if (!pickle.ReadInt(&iter, &kind))
|
| return;
|
|
|
| if (kind == FontConfigIPC::METHOD_MATCH) {
|
| - HandleFontMatchRequest(fd, iter, fds.get());
|
| + HandleFontMatchRequest(fd, pickle, iter, fds.get());
|
| } else if (kind == FontConfigIPC::METHOD_OPEN) {
|
| - HandleFontOpenRequest(fd, iter, fds.get());
|
| + HandleFontOpenRequest(fd, pickle, iter, fds.get());
|
| } else if (kind == LinuxSandbox::METHOD_GET_FALLBACK_FONT_FOR_CHAR) {
|
| - HandleGetFallbackFontForChar(fd, iter, fds.get());
|
| + HandleGetFallbackFontForChar(fd, pickle, iter, fds.get());
|
| } else if (kind == LinuxSandbox::METHOD_LOCALTIME) {
|
| - HandleLocaltime(fd, iter, fds.get());
|
| + HandleLocaltime(fd, pickle, iter, fds.get());
|
| } else if (kind == LinuxSandbox::METHOD_GET_STYLE_FOR_STRIKE) {
|
| - HandleGetStyleForStrike(fd, iter, fds.get());
|
| + HandleGetStyleForStrike(fd, pickle, iter, fds.get());
|
| } else if (kind == LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT) {
|
| - HandleMakeSharedMemorySegment(fd, iter, fds.get());
|
| + HandleMakeSharedMemorySegment(fd, pickle, iter, fds.get());
|
| } else if (kind == LinuxSandbox::METHOD_MATCH_WITH_FALLBACK) {
|
| - HandleMatchWithFallback(fd, iter, fds.get());
|
| + HandleMatchWithFallback(fd, pickle, iter, fds.get());
|
| }
|
| }
|
|
|
| @@ -176,11 +176,13 @@
|
|
|
| void SandboxIPCHandler::HandleFontMatchRequest(
|
| int fd,
|
| + const Pickle& pickle,
|
| PickleIterator iter,
|
| const std::vector<base::ScopedFD*>& fds) {
|
| uint32_t requested_style;
|
| std::string family;
|
| - if (!iter.ReadString(&family) || !iter.ReadUInt32(&requested_style))
|
| + if (!pickle.ReadString(&iter, &family) ||
|
| + !pickle.ReadUInt32(&iter, &requested_style))
|
| return;
|
|
|
| SkFontConfigInterface::FontIdentity result_identity;
|
| @@ -214,10 +216,11 @@
|
|
|
| void SandboxIPCHandler::HandleFontOpenRequest(
|
| int fd,
|
| + const Pickle& pickle,
|
| PickleIterator iter,
|
| const std::vector<base::ScopedFD*>& fds) {
|
| uint32_t index;
|
| - if (!iter.ReadUInt32(&index))
|
| + if (!pickle.ReadUInt32(&iter, &index))
|
| return;
|
| if (index >= static_cast<uint32_t>(paths_.count()))
|
| return;
|
| @@ -242,6 +245,7 @@
|
|
|
| void SandboxIPCHandler::HandleGetFallbackFontForChar(
|
| int fd,
|
| + const Pickle& pickle,
|
| PickleIterator iter,
|
| const std::vector<base::ScopedFD*>& fds) {
|
| // The other side of this call is
|
| @@ -249,11 +253,11 @@
|
|
|
| EnsureWebKitInitialized();
|
| WebUChar32 c;
|
| - if (!iter.ReadInt(&c))
|
| + if (!pickle.ReadInt(&iter, &c))
|
| return;
|
|
|
| std::string preferred_locale;
|
| - if (!iter.ReadString(&preferred_locale))
|
| + if (!pickle.ReadString(&iter, &preferred_locale))
|
| return;
|
|
|
| blink::WebFallbackFont fallbackFont;
|
| @@ -282,16 +286,17 @@
|
|
|
| void SandboxIPCHandler::HandleGetStyleForStrike(
|
| int fd,
|
| + const Pickle& pickle,
|
| PickleIterator iter,
|
| const std::vector<base::ScopedFD*>& fds) {
|
| std::string family;
|
| bool bold, italic;
|
| uint16 pixel_size;
|
|
|
| - if (!iter.ReadString(&family) ||
|
| - !iter.ReadBool(&bold) ||
|
| - !iter.ReadBool(&italic) ||
|
| - !iter.ReadUInt16(&pixel_size)) {
|
| + if (!pickle.ReadString(&iter, &family) ||
|
| + !pickle.ReadBool(&iter, &bold) ||
|
| + !pickle.ReadBool(&iter, &italic) ||
|
| + !pickle.ReadUInt16(&iter, &pixel_size)) {
|
| return;
|
| }
|
|
|
| @@ -320,13 +325,16 @@
|
|
|
| void SandboxIPCHandler::HandleLocaltime(
|
| int fd,
|
| + const Pickle& pickle,
|
| PickleIterator iter,
|
| const std::vector<base::ScopedFD*>& fds) {
|
| // The other side of this call is in zygote_main_linux.cc
|
|
|
| std::string time_string;
|
| - if (!iter.ReadString(&time_string) || time_string.size() != sizeof(time_t))
|
| - return;
|
| + if (!pickle.ReadString(&iter, &time_string) ||
|
| + time_string.size() != sizeof(time_t)) {
|
| + return;
|
| + }
|
|
|
| time_t time;
|
| memcpy(&time, time_string.data(), sizeof(time));
|
| @@ -350,14 +358,15 @@
|
|
|
| void SandboxIPCHandler::HandleMakeSharedMemorySegment(
|
| int fd,
|
| + const Pickle& pickle,
|
| PickleIterator iter,
|
| const std::vector<base::ScopedFD*>& fds) {
|
| base::SharedMemoryCreateOptions options;
|
| uint32_t size;
|
| - if (!iter.ReadUInt32(&size))
|
| + if (!pickle.ReadUInt32(&iter, &size))
|
| return;
|
| options.size = size;
|
| - if (!iter.ReadBool(&options.executable))
|
| + if (!pickle.ReadBool(&iter, &options.executable))
|
| return;
|
| int shm_fd = -1;
|
| base::SharedMemory shm;
|
| @@ -369,17 +378,18 @@
|
|
|
| void SandboxIPCHandler::HandleMatchWithFallback(
|
| int fd,
|
| + const Pickle& pickle,
|
| PickleIterator iter,
|
| const std::vector<base::ScopedFD*>& fds) {
|
| std::string face;
|
| bool is_bold, is_italic;
|
| uint32 charset, fallback_family;
|
|
|
| - if (!iter.ReadString(&face) || face.empty() ||
|
| - !iter.ReadBool(&is_bold) ||
|
| - !iter.ReadBool(&is_italic) ||
|
| - !iter.ReadUInt32(&charset) ||
|
| - !iter.ReadUInt32(&fallback_family)) {
|
| + if (!pickle.ReadString(&iter, &face) || face.empty() ||
|
| + !pickle.ReadBool(&iter, &is_bold) ||
|
| + !pickle.ReadBool(&iter, &is_italic) ||
|
| + !pickle.ReadUInt32(&iter, &charset) ||
|
| + !pickle.ReadUInt32(&iter, &fallback_family)) {
|
| return;
|
| }
|
|
|
|
|