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

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

Issue 2843113002: make base::SharedMemoryHandle a class on POSIX. (Closed)
Patch Set: Fix test error. Created 3 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/sandbox_ipc_linux.h" 5 #include "content/browser/renderer_host/sandbox_ipc_linux.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 base::SharedMemoryCreateOptions options; 334 base::SharedMemoryCreateOptions options;
335 uint32_t size; 335 uint32_t size;
336 if (!iter.ReadUInt32(&size)) 336 if (!iter.ReadUInt32(&size))
337 return; 337 return;
338 options.size = size; 338 options.size = size;
339 if (!iter.ReadBool(&options.executable)) 339 if (!iter.ReadBool(&options.executable))
340 return; 340 return;
341 int shm_fd = -1; 341 int shm_fd = -1;
342 base::SharedMemory shm; 342 base::SharedMemory shm;
343 if (shm.Create(options)) 343 if (shm.Create(options))
344 shm_fd = shm.handle().fd; 344 shm_fd = shm.handle().GetHandle();
345 base::Pickle reply; 345 base::Pickle reply;
346 SendRendererReply(fds, reply, shm_fd); 346 SendRendererReply(fds, reply, shm_fd);
347 } 347 }
348 348
349 void SandboxIPCHandler::HandleMatchWithFallback( 349 void SandboxIPCHandler::HandleMatchWithFallback(
350 int fd, 350 int fd,
351 base::PickleIterator iter, 351 base::PickleIterator iter,
352 const std::vector<base::ScopedFD>& fds) { 352 const std::vector<base::ScopedFD>& fds) {
353 std::string face; 353 std::string face;
354 bool is_bold; 354 bool is_bold;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 413 }
414 414
415 SandboxIPCHandler::~SandboxIPCHandler() { 415 SandboxIPCHandler::~SandboxIPCHandler() {
416 if (IGNORE_EINTR(close(lifeline_fd_)) < 0) 416 if (IGNORE_EINTR(close(lifeline_fd_)) < 0)
417 PLOG(ERROR) << "close"; 417 PLOG(ERROR) << "close";
418 if (IGNORE_EINTR(close(browser_socket_)) < 0) 418 if (IGNORE_EINTR(close(browser_socket_)) < 0)
419 PLOG(ERROR) << "close"; 419 PLOG(ERROR) << "close";
420 } 420 }
421 421
422 } // namespace content 422 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698